From 849d84b9d81a47a87d12bbb2305b40c8179a9620 Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 20:50:32 +0900 Subject: [PATCH 01/11] =?UTF-8?q?=E2=9C=A8=20Modify=20log=20level=20for=20?= =?UTF-8?q?start=20log=20in=20order=20to=20reduce=20logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- step_options.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/step_options.go b/step_options.go index 4aa3579..856d1bd 100644 --- a/step_options.go +++ b/step_options.go @@ -57,11 +57,11 @@ func defaultStepOptions(msgb StepEventMsgBuilder, step Step, completeLevel Level var startLevel Level switch completeLevel { // nolint:exhaustive case LevelError: - startLevel = LevelInfo - case LevelInfo: startLevel = LevelDebug - case LevelDebug: + case LevelInfo: startLevel = LevelTrace + case LevelDebug: + startLevel = LevelVerbose default: startLevel = LevelVerbose } From c445e8a146136c96af50539f1e56f325c01712f5 Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 20:51:06 +0900 Subject: [PATCH 02/11] =?UTF-8?q?=E2=9C=85=20Follow=20modification=20of=20?= =?UTF-8?q?start=20log=20level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- step_options_test.go | 4 +- tests/mysql/low_level_with_context_test.go | 74 +++++++++---------- tests/postgres/low_level_with_context_test.go | 48 ++++++------ tests/sqlite3/low_level_with_context_test.go | 64 ++++++++-------- .../sqlite3/low_level_without_context_test.go | 64 ++++++++-------- 5 files changed, 127 insertions(+), 127 deletions(-) diff --git a/step_options_test.go b/step_options_test.go index ae95ef1..a1591bb 100644 --- a/step_options_test.go +++ b/step_options_test.go @@ -69,8 +69,8 @@ func TestDefaultStepOptions(t *testing.T) { t.Run("LevelError", func(t *testing.T) { t.Parallel() o := defaultStepOptions(StepEventMsgWithoutEventName, Step("test"), LevelError) - if o.Start.Level != LevelInfo { - t.Errorf("Expected %v, but got %v", LevelInfo, o.Start.Level) + if o.Start.Level != LevelDebug { + t.Errorf("Expected %v, but got %v", LevelDebug, o.Start.Level) } if o.Complete.Level != LevelError { t.Errorf("Expected %v, but got %v", LevelError, o.Complete.Level) diff --git a/tests/mysql/low_level_with_context_test.go b/tests/mysql/low_level_with_context_test.go index 99af0d6..be61849 100644 --- a/tests/mysql/low_level_with_context_test.go +++ b/tests/mysql/low_level_with_context_test.go @@ -59,8 +59,8 @@ func TestLowLevelWithContext(t *testing.T) { t.Run("sqlslog.Open log", func(t *testing.T) { logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "sqlslog.Open Start", "driver": "mysql", "dsn": dsn}, - {"level": "DEBUG", "msg": "Driver.OpenConnector Start", "dsn": dsn}, + {"level": "TRACE", "msg": "sqlslog.Open Start", "driver": "mysql", "dsn": dsn}, + {"level": "TRACE", "msg": "Driver.OpenConnector Start", "dsn": dsn}, {"level": "INFO", "msg": "Driver.OpenConnector Complete", "dsn": dsn, connIDKey: connIDExpected}, {"level": "INFO", "msg": "sqlslog.Open Complete", "driver": "mysql", "dsn": dsn}, }) @@ -95,7 +95,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": "[]", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": "[]", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": "[]", connIDKey: connIDExpected}, }) @@ -116,7 +116,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -126,7 +126,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -139,7 +139,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -157,13 +157,13 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, "skip": true, connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": "INSERT INTO test1 (id, name) VALUES (?, ?)", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": "INSERT INTO test1 (id, name) VALUES (?, ?)", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": "INSERT INTO test1 (id, name) VALUES (?, ?)", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -190,11 +190,11 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.QueryContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.QueryContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.QueryContext Complete", "query": query, "args": args, "skip": true, connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": "SELECT id, name FROM test1 WHERE name LIKE ?", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": "SELECT id, name FROM test1 WHERE name LIKE ?", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": "SELECT id, name FROM test1 WHERE name LIKE ?", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "DEBUG", "msg": "Stmt.QueryContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -255,7 +255,7 @@ func TestLowLevelWithContext(t *testing.T) { actualResults := []map[string]interface{}{} for rows.Next() { logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) logs.Start() @@ -272,11 +272,11 @@ func TestLowLevelWithContext(t *testing.T) { } logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": true, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -301,7 +301,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -309,7 +309,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -322,11 +322,11 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) assert.Equal(t, test1Record{ID: 1, Name: "foo"}, foo) @@ -342,7 +342,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -350,7 +350,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -362,7 +362,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() @@ -381,7 +381,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.BeginTx Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) @@ -393,13 +393,13 @@ func TestLowLevelWithContext(t *testing.T) { args := "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, "skip": true, connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -412,7 +412,7 @@ func TestLowLevelWithContext(t *testing.T) { err := tx.Rollback() assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, + {"level": "TRACE", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, {"level": "INFO", "msg": "Tx.Rollback Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) @@ -425,7 +425,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.BeginTx Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) @@ -437,13 +437,13 @@ func TestLowLevelWithContext(t *testing.T) { args := "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, "skip": true, connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -456,7 +456,7 @@ func TestLowLevelWithContext(t *testing.T) { err := tx.Commit() assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Tx.Commit Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, + {"level": "TRACE", "msg": "Tx.Commit Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, {"level": "INFO", "msg": "Tx.Commit Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) diff --git a/tests/postgres/low_level_with_context_test.go b/tests/postgres/low_level_with_context_test.go index 7f7a06e..56614ba 100644 --- a/tests/postgres/low_level_with_context_test.go +++ b/tests/postgres/low_level_with_context_test.go @@ -59,7 +59,7 @@ func TestLowLevelWithContext(t *testing.T) { t.Run("sqlslog.Open log", func(t *testing.T) { logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "sqlslog.Open Start", "driver": "postgres", "dsn": dsn}, + {"level": "TRACE", "msg": "sqlslog.Open Start", "driver": "postgres", "dsn": dsn}, {"level": "INFO", "msg": "sqlslog.Open Complete", "driver": "postgres", "dsn": dsn}, }) }) @@ -93,7 +93,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": "[]", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": "[]", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": "[]", connIDKey: connIDExpected}, }) @@ -113,7 +113,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -123,7 +123,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -136,7 +136,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -152,7 +152,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": fmt.Sprintf("[{Name: Ordinal:1 Value:%d} {Name: Ordinal:2 Value:%s}]", i+1, name), connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": fmt.Sprintf("[{Name: Ordinal:1 Value:%d} {Name: Ordinal:2 Value:%s}]", i+1, name), connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": fmt.Sprintf("[{Name: Ordinal:1 Value:%d} {Name: Ordinal:2 Value:%s}]", i+1, name), connIDKey: connIDExpected}, }) @@ -179,7 +179,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.QueryContext Start", "query": query, "args": "[{Name: Ordinal:1 Value:ba%}]", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.QueryContext Start", "query": query, "args": "[{Name: Ordinal:1 Value:ba%}]", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.QueryContext Complete", "query": query, "args": "[{Name: Ordinal:1 Value:ba%}]", connIDKey: connIDExpected}, }) @@ -240,7 +240,7 @@ func TestLowLevelWithContext(t *testing.T) { actualResults := []map[string]interface{}{} for rows.Next() { logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected}, }) logs.Start() @@ -257,9 +257,9 @@ func TestLowLevelWithContext(t *testing.T) { } logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": true, connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Rows.Close Start", connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected}, {"level": "DEBUG", "msg": "Rows.Close Complete", connIDKey: connIDExpected}, }) @@ -284,7 +284,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -292,7 +292,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -305,11 +305,11 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) assert.Equal(t, test1Record{ID: 1, Name: "foo"}, foo) @@ -325,7 +325,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -333,7 +333,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -345,7 +345,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() @@ -364,7 +364,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.BeginTx Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) @@ -374,7 +374,7 @@ func TestLowLevelWithContext(t *testing.T) { r, err := tx.ExecContext(ctx, query, "qux", int64(3)) assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]", connIDKey: connIDExpected}, }) @@ -387,7 +387,7 @@ func TestLowLevelWithContext(t *testing.T) { err := tx.Rollback() assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, + {"level": "TRACE", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, {"level": "INFO", "msg": "Tx.Rollback Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) @@ -400,7 +400,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.BeginTx Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) @@ -410,7 +410,7 @@ func TestLowLevelWithContext(t *testing.T) { r, err := tx.ExecContext(ctx, query, "quux", int64(3)) assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]", connIDKey: connIDExpected}, }) @@ -423,7 +423,7 @@ func TestLowLevelWithContext(t *testing.T) { err := tx.Commit() assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Tx.Commit Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, + {"level": "TRACE", "msg": "Tx.Commit Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, {"level": "INFO", "msg": "Tx.Commit Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) diff --git a/tests/sqlite3/low_level_with_context_test.go b/tests/sqlite3/low_level_with_context_test.go index 1e3c1de..a882ddb 100644 --- a/tests/sqlite3/low_level_with_context_test.go +++ b/tests/sqlite3/low_level_with_context_test.go @@ -49,7 +49,7 @@ func TestLowLevelWithContext(t *testing.T) { t.Run("sqlslog.Open log", func(t *testing.T) { logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "sqlslog.Open Start", "driver": "sqlite3", "dsn": dsn}, + {"level": "TRACE", "msg": "sqlslog.Open Start", "driver": "sqlite3", "dsn": dsn}, {"level": "INFO", "msg": "sqlslog.Open Complete", "driver": "sqlite3", "dsn": dsn}, }) }) @@ -83,7 +83,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": "[]", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": "[]", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": "[]", connIDKey: connIDExpected}, }) @@ -104,7 +104,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -114,7 +114,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -127,7 +127,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -144,7 +144,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, connIDKey: connIDExpected}, }) @@ -214,7 +214,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.QueryContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.QueryContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.QueryContext Complete", "query": query, "args": args, connIDKey: connIDExpected}, }) @@ -275,7 +275,7 @@ func TestLowLevelWithContext(t *testing.T) { actualResults := []map[string]interface{}{} for rows.Next() { logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected}, }) logs.Start() @@ -290,9 +290,9 @@ func TestLowLevelWithContext(t *testing.T) { } logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": true, connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Rows.Close Start", connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected}, {"level": "DEBUG", "msg": "Rows.Close Complete", connIDKey: connIDExpected}, }) @@ -317,7 +317,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -325,7 +325,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -338,11 +338,11 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) assert.Equal(t, test1Record{ID: 1, Name: "foo"}, foo) @@ -357,7 +357,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "ERROR", "msg": "Conn.PrepareContext Error", "query": query, "error": "near \"invalid\": syntax error", connIDKey: connIDExpected}, }) }) @@ -371,7 +371,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -379,7 +379,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -392,7 +392,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() @@ -407,7 +407,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "ERROR", "msg": "Stmt.ExecContext Error", "args": args, "error": "datatype mismatch", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -424,7 +424,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.BeginTx Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) @@ -435,7 +435,7 @@ func TestLowLevelWithContext(t *testing.T) { args := "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, connIDKey: connIDExpected}, }) @@ -448,7 +448,7 @@ func TestLowLevelWithContext(t *testing.T) { err := tx.Rollback() assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, + {"level": "TRACE", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, {"level": "INFO", "msg": "Tx.Rollback Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) @@ -461,7 +461,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.BeginTx Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) @@ -472,7 +472,7 @@ func TestLowLevelWithContext(t *testing.T) { args := "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, connIDKey: connIDExpected}, }) @@ -485,7 +485,7 @@ func TestLowLevelWithContext(t *testing.T) { err := tx.Commit() assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Tx.Commit Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, + {"level": "TRACE", "msg": "Tx.Commit Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, {"level": "INFO", "msg": "Tx.Commit Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) @@ -524,7 +524,7 @@ func TestLowLevelWithContext(t *testing.T) { tx, err = dConn.Begin() require.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.Begin Start", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.Begin Start", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.Begin Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) @@ -537,7 +537,7 @@ func TestLowLevelWithContext(t *testing.T) { stmt, err := dConn.Prepare(query) require.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.Prepare Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.Prepare Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.Prepare Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -545,7 +545,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -573,7 +573,7 @@ func TestLowLevelWithContext(t *testing.T) { assert.NoError(t, err) args := "[4 qux]" logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Exec Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Exec Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Exec Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() @@ -586,7 +586,7 @@ func TestLowLevelWithContext(t *testing.T) { assert.Error(t, err) args := "[abc qux]" logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Exec Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Exec Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "ERROR", "msg": "Stmt.Exec Error", "args": args, "error": "datatype mismatch", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -598,7 +598,7 @@ func TestLowLevelWithContext(t *testing.T) { err := tx.Rollback() require.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, + {"level": "TRACE", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, {"level": "INFO", "msg": "Tx.Rollback Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) diff --git a/tests/sqlite3/low_level_without_context_test.go b/tests/sqlite3/low_level_without_context_test.go index 2c16231..a86c5f1 100644 --- a/tests/sqlite3/low_level_without_context_test.go +++ b/tests/sqlite3/low_level_without_context_test.go @@ -49,7 +49,7 @@ func TestLowLevelWithoutContext(t *testing.T) { t.Run("sqlslog.Open log", func(t *testing.T) { logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "sqlslog.Open Start", "driver": "sqlite3", "dsn": dsn}, + {"level": "TRACE", "msg": "sqlslog.Open Start", "driver": "sqlite3", "dsn": dsn}, {"level": "INFO", "msg": "sqlslog.Open Complete", "driver": "sqlite3", "dsn": dsn}, }) }) @@ -83,7 +83,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": "[]", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": "[]", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": "[]", connIDKey: connIDExpected}, }) @@ -104,7 +104,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -114,7 +114,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -127,7 +127,7 @@ func TestLowLevelWithoutContext(t *testing.T) { buf.Reset() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -144,7 +144,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, connIDKey: connIDExpected}, }) @@ -214,7 +214,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.QueryContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.QueryContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.QueryContext Complete", "query": query, "args": args, connIDKey: connIDExpected}, }) @@ -275,7 +275,7 @@ func TestLowLevelWithoutContext(t *testing.T) { actualResults := []map[string]interface{}{} for rows.Next() { logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected}, }) buf.Reset() @@ -290,9 +290,9 @@ func TestLowLevelWithoutContext(t *testing.T) { } logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": true, connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Rows.Close Start", connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected}, {"level": "DEBUG", "msg": "Rows.Close Complete", connIDKey: connIDExpected}, }) @@ -317,7 +317,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -325,7 +325,7 @@ func TestLowLevelWithoutContext(t *testing.T) { buf.Reset() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -338,11 +338,11 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) assert.Equal(t, test1Record{ID: 1, Name: "foo"}, foo) @@ -359,7 +359,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -367,7 +367,7 @@ func TestLowLevelWithoutContext(t *testing.T) { buf.Reset() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -379,7 +379,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() @@ -398,7 +398,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.BeginTx Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) @@ -409,7 +409,7 @@ func TestLowLevelWithoutContext(t *testing.T) { args := "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, connIDKey: connIDExpected}, }) @@ -422,7 +422,7 @@ func TestLowLevelWithoutContext(t *testing.T) { err := tx.Rollback() assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, + {"level": "TRACE", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, {"level": "INFO", "msg": "Tx.Rollback Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) @@ -435,7 +435,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.BeginTx Start", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.BeginTx Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) @@ -446,7 +446,7 @@ func TestLowLevelWithoutContext(t *testing.T) { args := "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, connIDKey: connIDExpected}, }) @@ -459,7 +459,7 @@ func TestLowLevelWithoutContext(t *testing.T) { err := tx.Commit() assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Tx.Commit Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, + {"level": "TRACE", "msg": "Tx.Commit Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, {"level": "INFO", "msg": "Tx.Commit Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) @@ -499,7 +499,7 @@ func TestLowLevelWithoutContext(t *testing.T) { tx, err = dConn.Begin() require.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.Begin Start", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.Begin Start", connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.Begin Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) @@ -512,7 +512,7 @@ func TestLowLevelWithoutContext(t *testing.T) { stmt, err := dConn.Prepare(query) require.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.Prepare Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.Prepare Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.Prepare Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -520,7 +520,7 @@ func TestLowLevelWithoutContext(t *testing.T) { buf.Reset() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -540,7 +540,7 @@ func TestLowLevelWithoutContext(t *testing.T) { stmt, err := dConn.Prepare(query) require.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Conn.Prepare Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.Prepare Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.Prepare Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) @@ -548,7 +548,7 @@ func TestLowLevelWithoutContext(t *testing.T) { buf.Reset() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -567,7 +567,7 @@ func TestLowLevelWithoutContext(t *testing.T) { err := tx.Rollback() require.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, + {"level": "TRACE", "msg": "Tx.Rollback Start", connIDKey: connIDExpected, txIDKey: txIDExpected}, {"level": "INFO", "msg": "Tx.Rollback Complete", connIDKey: connIDExpected, txIDKey: txIDExpected}, }) }) @@ -592,7 +592,7 @@ func TestLowLevelWithoutContext(t *testing.T) { buf.Reset() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "DEBUG", "msg": "Stmt.Close Start", stmtIDKey: stmtIDExpected, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Stmt.Close Start", stmtIDKey: stmtIDExpected, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Stmt.Close Complete", stmtIDKey: stmtIDExpected, connIDKey: connIDExpected}, }) }() @@ -600,7 +600,7 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "DEBUG", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) From e1d755c628f746bea0cbf96c502234ec68fdc908 Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 21:54:31 +0900 Subject: [PATCH 03/11] =?UTF-8?q?=E2=9C=A8=20Add=20functions=20to=20format?= =?UTF-8?q?=20Value=20or=20NamedValue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - formatNamedValues - formatValues - formatValue --- conn.go | 5 ++- stmt.go | 9 +++-- stmt_args.go | 84 +++++++++++++++++++++++++++++++++++++++++++++++ stmt_args_test.go | 61 ++++++++++++++++++++++++++++++++++ 4 files changed, 151 insertions(+), 8 deletions(-) create mode 100644 stmt_args.go create mode 100644 stmt_args_test.go diff --git a/conn.go b/conn.go index 43b9bd4..ac19c7d 100644 --- a/conn.go +++ b/conn.go @@ -4,7 +4,6 @@ import ( "context" "database/sql/driver" "errors" - "fmt" "log/slog" ) @@ -235,7 +234,7 @@ func (c *connWithContextWrapper) ExecContext(ctx context.Context, query string, var result driver.Result lg := c.logger.With( slog.String("query", query), - slog.String("args", fmt.Sprintf("%+v", args)), + slog.String("args", formatNamedValues(args)), ) err := ignoreAttr(lg.Step(ctx, &c.options.ExecContext, func() (*slog.Attr, error) { var err error @@ -253,7 +252,7 @@ func (c *connWithContextWrapper) QueryContext(ctx context.Context, query string, var rows driver.Rows lg := c.logger.With( slog.String("query", query), - slog.String("args", fmt.Sprintf("%+v", args)), + slog.String("args", formatNamedValues(args)), ) err := ignoreAttr(lg.Step(ctx, &c.options.QueryContext, func() (*slog.Attr, error) { var err error diff --git a/stmt.go b/stmt.go index 2a0eb14..4e30d19 100644 --- a/stmt.go +++ b/stmt.go @@ -3,7 +3,6 @@ package sqlslog import ( "context" "database/sql/driver" - "fmt" "log/slog" ) @@ -88,7 +87,7 @@ func (s *stmtWrapper) Close() error { // Exec implements driver.Stmt. func (s *stmtWrapper) Exec(args []driver.Value) (driver.Result, error) { - lg := s.logger.With(slog.String("args", fmt.Sprintf("%+v", args))) + lg := s.logger.With(slog.String("args", formatValues(args))) var result driver.Result err := ignoreAttr(lg.StepWithoutContext(&s.options.Exec, func() (*slog.Attr, error) { var err error @@ -108,7 +107,7 @@ func (s *stmtWrapper) NumInput() int { // Query implements driver.Stmt. func (s *stmtWrapper) Query(args []driver.Value) (driver.Rows, error) { - lg := s.logger.With(slog.String("args", fmt.Sprintf("%+v", args))) + lg := s.logger.With(slog.String("args", formatValues(args))) var rows driver.Rows err := ignoreAttr(lg.StepWithoutContext(&s.options.Query, func() (*slog.Attr, error) { var err error @@ -131,7 +130,7 @@ var _ driver.StmtExecContext = (*stmtExecContextWrapperImpl)(nil) // ExecContext implements driver.StmtExecContext. func (s *stmtExecContextWrapperImpl) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error) { - lg := s.logger.With(slog.String("args", fmt.Sprintf("%+v", args))) + lg := s.logger.With(slog.String("args", formatNamedValues(args))) var result driver.Result err := ignoreAttr(lg.Step(ctx, &s.options.ExecContext, func() (*slog.Attr, error) { var err error @@ -154,7 +153,7 @@ var _ driver.StmtQueryContext = (*stmtQueryContextWrapperImpl)(nil) // QueryContext implements driver.StmtQueryContext. func (s *stmtQueryContextWrapperImpl) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error) { - lg := s.logger.With(slog.String("args", fmt.Sprintf("%+v", args))) + lg := s.logger.With(slog.String("args", formatNamedValues(args))) var rows driver.Rows err := ignoreAttr(lg.Step(ctx, &s.options.QueryContext, func() (*slog.Attr, error) { var err error diff --git a/stmt_args.go b/stmt_args.go new file mode 100644 index 0000000..c4550b2 --- /dev/null +++ b/stmt_args.go @@ -0,0 +1,84 @@ +package sqlslog + +import ( + "database/sql/driver" + "fmt" + "slices" + "strings" +) + +func cmpNamedValueByOrdinal(a, b driver.NamedValue) int { + return a.Ordinal - b.Ordinal +} + +func formatNamedValues(args []driver.NamedValue) string { + if len(args) == 0 { + return "[]" + } + if !slices.ContainsFunc(args, func(arg driver.NamedValue) bool { return arg.Name == "" }) { + var b strings.Builder + b.WriteString("{") + for i, arg := range args { + if i > 0 { + b.WriteString(",") + } + fmt.Fprintf(&b, "%s:", arg.Name) + b.WriteString(formatValue(arg.Value)) + } + b.WriteString("}") + return b.String() + } + if !slices.ContainsFunc(args, func(arg driver.NamedValue) bool { return arg.Name != "" }) { + if !slices.IsSortedFunc(args, cmpNamedValueByOrdinal) { + slices.SortFunc(args, cmpNamedValueByOrdinal) + } + var b strings.Builder + b.WriteString("[") + for i, arg := range args { + if i > 0 { + b.WriteString(",") + } + b.WriteString(formatValue(arg.Value)) + } + b.WriteString("]") + return b.String() + } + var b strings.Builder + b.WriteString("[") + for i, arg := range args { + if i > 0 { + b.WriteString(",") + } + fmt.Fprintf(&b, "[%d]%s:", arg.Ordinal, arg.Name) + b.WriteString(formatValue(arg.Value)) + } + b.WriteString("]") + return b.String() +} + +func formatValues(values []driver.Value) string { + if len(values) == 0 { + return "[]" + } + var b strings.Builder + b.WriteString("[") + for i, value := range values { + if i > 0 { + b.WriteString(",") + } + b.WriteString(formatValue(value)) + } + b.WriteString("]") + return b.String() +} + +func formatValue(v any) string { + switch v := v.(type) { + case string: + return fmt.Sprintf("%q", v) + case []byte: + return fmt.Sprintf("%q", v) + default: + return fmt.Sprintf("%v", v) + } +} diff --git a/stmt_args_test.go b/stmt_args_test.go new file mode 100644 index 0000000..27558ec --- /dev/null +++ b/stmt_args_test.go @@ -0,0 +1,61 @@ +package sqlslog + +import ( + "database/sql/driver" + "testing" +) + +func TestFormatNamedValues(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + args []driver.NamedValue + want string + }{ + { + name: "empty", + args: nil, + want: "[]", + }, + { + name: "no names without ordinals", + args: []driver.NamedValue{{Value: "A"}, {Value: 2}}, + want: "[\"A\",2]", + }, + { + name: "no names with sorted ordinals", + args: []driver.NamedValue{{Ordinal: 1, Value: "a"}, {Ordinal: 2, Value: 100}, {Ordinal: 3, Value: 1.234}}, + want: "[\"a\",100,1.234]", + }, + { + name: "no names with unsorted ordinals", + args: []driver.NamedValue{{Ordinal: 2, Value: 100}, {Ordinal: 3, Value: 1.234}, {Ordinal: 1, Value: "a"}}, + want: "[\"a\",100,1.234]", + }, + { + name: "no names with invalid ordinals", + args: []driver.NamedValue{{Ordinal: 2, Value: 100}, {Ordinal: 5, Value: 1.234}, {Ordinal: 0, Value: "a"}}, + want: "[\"a\",100,1.234]", + }, + { + name: "all names", + args: []driver.NamedValue{{Name: "a", Value: 1}, {Name: "b", Value: 2}}, + want: "{a:1,b:2}", + }, + { + name: "mixed names", + args: []driver.NamedValue{{Ordinal: 0, Name: "a", Value: 1}, {Ordinal: 1, Name: "", Value: 2}}, + want: "[[0]a:1,[1]:2]", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := formatNamedValues(tt.args) + if got != tt.want { + t.Errorf("formatNamedValues() = %v, want %v", got, tt.want) + } + }) + } +} From 9dbb1a7a2863f86aed9be592b3e5cec4e488e53d Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 21:54:55 +0900 Subject: [PATCH 04/11] =?UTF-8?q?=E2=9C=85=20Follow=20format=20modificatio?= =?UTF-8?q?n=20of=20args?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/mysql/low_level_with_context_test.go | 16 ++++++------- tests/postgres/low_level_with_context_test.go | 24 +++++++++---------- tests/sqlite3/low_level_with_context_test.go | 22 ++++++++--------- .../sqlite3/low_level_without_context_test.go | 16 ++++++------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/tests/mysql/low_level_with_context_test.go b/tests/mysql/low_level_with_context_test.go index be61849..3c44c2c 100644 --- a/tests/mysql/low_level_with_context_test.go +++ b/tests/mysql/low_level_with_context_test.go @@ -150,7 +150,7 @@ func TestLowLevelWithContext(t *testing.T) { t.Run("insert "+name, func(t *testing.T) { stmtIDExpected := seqIdGen.Next() query := "INSERT INTO test1 (id, name) VALUES (?, ?)" - args := fmt.Sprintf("[{Name: Ordinal:1 Value:%d} {Name: Ordinal:2 Value:%s}]", i+1, name) + args := fmt.Sprintf("[%d,%q]", i+1, name) logs.Start() result, err := db.ExecContext(ctx, query, i+1, name) assert.NoError(t, err) @@ -186,7 +186,7 @@ func TestLowLevelWithContext(t *testing.T) { assert.NoError(t, rows.Close()) logs.AssertEmpty(t) // Rows.Close and Stmt.Close are called from rows.Next when EOF }() - args := "[{Name: Ordinal:1 Value:ba%}]" + args := "[\"ba%\"]" logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, @@ -322,8 +322,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, @@ -362,8 +362,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() assert.NoError(t, err) @@ -390,7 +390,7 @@ func TestLowLevelWithContext(t *testing.T) { query := "UPDATE test1 SET name = ? WHERE id = ?" logs.Start() r, err := tx.ExecContext(ctx, query, "qux", 3) - args := "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]" + args := "[\"qux\",3]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, @@ -434,7 +434,7 @@ func TestLowLevelWithContext(t *testing.T) { query := "UPDATE test1 SET name = ? WHERE id = ?" logs.Start() r, err := tx.ExecContext(ctx, query, "quux", 3) - args := "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]" + args := "[\"quux\",3]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, diff --git a/tests/postgres/low_level_with_context_test.go b/tests/postgres/low_level_with_context_test.go index 56614ba..451cef3 100644 --- a/tests/postgres/low_level_with_context_test.go +++ b/tests/postgres/low_level_with_context_test.go @@ -152,8 +152,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": fmt.Sprintf("[{Name: Ordinal:1 Value:%d} {Name: Ordinal:2 Value:%s}]", i+1, name), connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": fmt.Sprintf("[{Name: Ordinal:1 Value:%d} {Name: Ordinal:2 Value:%s}]", i+1, name), connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": fmt.Sprintf("[%d,%q]", i+1, name), connIDKey: connIDExpected}, + {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": fmt.Sprintf("[%d,%q]", i+1, name), connIDKey: connIDExpected}, }) logs.Start() @@ -179,8 +179,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.QueryContext Start", "query": query, "args": "[{Name: Ordinal:1 Value:ba%}]", connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.QueryContext Complete", "query": query, "args": "[{Name: Ordinal:1 Value:ba%}]", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.QueryContext Start", "query": query, "args": "[\"ba%\"]", connIDKey: connIDExpected}, + {"level": "INFO", "msg": "Conn.QueryContext Complete", "query": query, "args": "[\"ba%\"]", connIDKey: connIDExpected}, }) t.Run("rows.Columns", func(t *testing.T) { @@ -305,8 +305,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, @@ -345,8 +345,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() assert.NoError(t, err) @@ -374,8 +374,8 @@ func TestLowLevelWithContext(t *testing.T) { r, err := tx.ExecContext(ctx, query, "qux", int64(3)) assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]", connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": "[\"qux\",3]", connIDKey: connIDExpected}, + {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": "[\"qux\",3]", connIDKey: connIDExpected}, }) rowsAffected, err := r.RowsAffected() @@ -410,8 +410,8 @@ func TestLowLevelWithContext(t *testing.T) { r, err := tx.ExecContext(ctx, query, "quux", int64(3)) assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]", connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": "[\"quux\",3]", connIDKey: connIDExpected}, + {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": "[\"quux\",3]", connIDKey: connIDExpected}, }) rowsAffected, err := r.RowsAffected() diff --git a/tests/sqlite3/low_level_with_context_test.go b/tests/sqlite3/low_level_with_context_test.go index a882ddb..eeea4c1 100644 --- a/tests/sqlite3/low_level_with_context_test.go +++ b/tests/sqlite3/low_level_with_context_test.go @@ -137,7 +137,7 @@ func TestLowLevelWithContext(t *testing.T) { for i, name := range testData { t.Run("insert "+name, func(t *testing.T) { query := "INSERT INTO test1 (id, name) VALUES (?, ?)" - args := fmt.Sprintf("[{Name: Ordinal:1 Value:%d} {Name: Ordinal:2 Value:%s}]", i+1, name) + args := fmt.Sprintf("[%d,%q]", i+1, name) logs.Start() result, err := db.ExecContext(ctx, query, i+1, name) assert.NoError(t, err) @@ -210,7 +210,7 @@ func TestLowLevelWithContext(t *testing.T) { // {"level": "DEBUG", "msg": "Rows.Close Complete"}, }) }() - args := "[{Name: Ordinal:1 Value:ba%}]" + args := "[\"ba%\"]" logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, @@ -338,8 +338,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, @@ -392,8 +392,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() assert.NoError(t, err) @@ -403,7 +403,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() _, err := stmt.ExecContext(ctx, "abc", "qux") assert.Error(t, err) - args := "[{Name: Ordinal:1 Value:abc} {Name: Ordinal:2 Value:qux}]" + args := "[\"abc\",\"qux\"]" logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, @@ -432,7 +432,7 @@ func TestLowLevelWithContext(t *testing.T) { query := "UPDATE test1 SET name = ? WHERE id = ?" logs.Start() r, err := tx.ExecContext(ctx, query, "qux", int64(3)) - args := "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]" + args := "[\"qux\",3]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, @@ -469,7 +469,7 @@ func TestLowLevelWithContext(t *testing.T) { query := "UPDATE test1 SET name = ? WHERE id = ?" logs.Start() r, err := tx.ExecContext(ctx, query, "quux", int64(3)) - args := "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]" + args := "[\"quux\",3]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, @@ -571,7 +571,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() result, err := stmt.Exec([]driver.Value{4, "qux"}) assert.NoError(t, err) - args := "[4 qux]" + args := "[4,\"qux\"]" logs.Assert(t, []map[string]interface{}{ {"level": "TRACE", "msg": "Stmt.Exec Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "INFO", "msg": "Stmt.Exec Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, @@ -584,7 +584,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() _, err := stmt.Exec([]driver.Value{"abc", "qux"}) assert.Error(t, err) - args := "[abc qux]" + args := "[\"abc\",\"qux\"]" logs.Assert(t, []map[string]interface{}{ {"level": "TRACE", "msg": "Stmt.Exec Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "ERROR", "msg": "Stmt.Exec Error", "args": args, "error": "datatype mismatch", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, diff --git a/tests/sqlite3/low_level_without_context_test.go b/tests/sqlite3/low_level_without_context_test.go index a86c5f1..7a58d02 100644 --- a/tests/sqlite3/low_level_without_context_test.go +++ b/tests/sqlite3/low_level_without_context_test.go @@ -137,7 +137,7 @@ func TestLowLevelWithoutContext(t *testing.T) { for i, name := range testData { t.Run("insert "+name, func(t *testing.T) { query := "INSERT INTO test1 (id, name) VALUES (?, ?)" - args := fmt.Sprintf("[{Name: Ordinal:1 Value:%d} {Name: Ordinal:2 Value:%s}]", i+1, name) + args := fmt.Sprintf("[%d,\"%s\"]", i+1, name) buf.Reset() result, err := db.Exec(query, i+1, name) assert.NoError(t, err) @@ -210,7 +210,7 @@ func TestLowLevelWithoutContext(t *testing.T) { // {"level": "DEBUG", "msg": "Rows.Close Complete"}, }) }() - args := "[{Name: Ordinal:1 Value:ba%}]" + args := "[\"ba%\"]" logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, @@ -338,8 +338,8 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[{Name: Ordinal:1 Value:1}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, @@ -379,8 +379,8 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[{Name: Ordinal:1 Value:4} {Name: Ordinal:2 Value:qux}]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() assert.NoError(t, err) @@ -406,7 +406,7 @@ func TestLowLevelWithoutContext(t *testing.T) { query := "UPDATE test1 SET name = ? WHERE id = ?" buf.Reset() r, err := tx.Exec(query, "qux", int64(3)) - args := "[{Name: Ordinal:1 Value:qux} {Name: Ordinal:2 Value:3}]" + args := "[\"qux\",3]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, @@ -443,7 +443,7 @@ func TestLowLevelWithoutContext(t *testing.T) { query := "UPDATE test1 SET name = ? WHERE id = ?" buf.Reset() r, err := tx.Exec(query, "quux", int64(3)) - args := "[{Name: Ordinal:1 Value:quux} {Name: Ordinal:2 Value:3}]" + args := "[\"quux\",3]" assert.NoError(t, err) logs.Assert(t, []map[string]interface{}{ {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, From d2ce9fb6b3a29947c0a0d8a4cfe67e6ff34e522c Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 22:43:10 +0900 Subject: [PATCH 05/11] =?UTF-8?q?=F0=9F=93=9D=20Update=20log=20examples=20?= =?UTF-8?q?in=20examples/logs-*/results?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $ make -C example --- examples/logs-mysql/results/debug-log.txt | 100 ++++------ examples/logs-mysql/results/info-log.txt | 68 +++---- examples/logs-mysql/results/trace-log.txt | 159 ++++++++-------- examples/logs-mysql/results/verbose-log.json | 174 ++++++++++-------- examples/logs-mysql/results/verbose-log.txt | 174 ++++++++++-------- examples/logs-postgres/results/debug-log.txt | 40 ++-- examples/logs-postgres/results/info-log.txt | 22 +-- examples/logs-postgres/results/trace-log.txt | 67 ++++--- .../logs-postgres/results/verbose-log.json | 82 ++++----- .../logs-postgres/results/verbose-log.txt | 82 ++++----- examples/logs-sqlite3/results/debug-log.txt | 34 ++-- examples/logs-sqlite3/results/info-log.txt | 18 +- examples/logs-sqlite3/results/trace-log.txt | 51 +++-- .../logs-sqlite3/results/verbose-log.json | 58 +++--- examples/logs-sqlite3/results/verbose-log.txt | 58 +++--- 15 files changed, 586 insertions(+), 601 deletions(-) diff --git a/examples/logs-mysql/results/debug-log.txt b/examples/logs-mysql/results/debug-log.txt index e7dba09..14576d2 100644 --- a/examples/logs-mysql/results/debug-log.txt +++ b/examples/logs-mysql/results/debug-log.txt @@ -1,65 +1,35 @@ -time=2025-02-19T08:24:59.722+09:00 level=DEBUG msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 -time=2025-02-19T08:24:59.722+09:00 level=DEBUG msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 -time=2025-02-19T08:24:59.722+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=3208 conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:24:59.722+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=225000 -time=2025-02-19T08:24:59.722+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:59.722+09:00 level=DEBUG msg=Connector.Connect conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:24:59.725+09:00 level=ERROR msg=Connector.Connect conn_id=GcehcYURvlj4lPDG duration=2847375 error="driver: bad connection" -time=2025-02-19T08:24:59.725+09:00 level=ERROR msg=Connector.Connect duration=2927833 error="driver: bad connection" -time=2025-02-19T08:24:59.725+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:59.725+09:00 level=DEBUG msg=Connector.Connect conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:24:59.726+09:00 level=ERROR msg=Connector.Connect conn_id=GcehcYURvlj4lPDG duration=977416 error="driver: bad connection" -time=2025-02-19T08:24:59.726+09:00 level=ERROR msg=Connector.Connect duration=1028333 error="driver: bad connection" -time=2025-02-19T08:24:59.726+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:59.726+09:00 level=DEBUG msg=Connector.Connect conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:24:59.730+09:00 level=ERROR msg=Connector.Connect conn_id=GcehcYURvlj4lPDG duration=3485500 error="driver: bad connection" -time=2025-02-19T08:24:59.730+09:00 level=ERROR msg=Connector.Connect duration=3563666 error="driver: bad connection" -time=2025-02-19T08:25:01.731+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:01.731+09:00 level=DEBUG msg=Connector.Connect conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:25:01.735+09:00 level=ERROR msg=Connector.Connect conn_id=GcehcYURvlj4lPDG duration=3532208 error="driver: bad connection" -time=2025-02-19T08:25:01.735+09:00 level=ERROR msg=Connector.Connect duration=3716958 error="driver: bad connection" -time=2025-02-19T08:25:01.735+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:01.735+09:00 level=DEBUG msg=Connector.Connect conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:25:01.738+09:00 level=ERROR msg=Connector.Connect conn_id=GcehcYURvlj4lPDG duration=3166875 error="driver: bad connection" -time=2025-02-19T08:25:01.738+09:00 level=ERROR msg=Connector.Connect duration=3307167 error="driver: bad connection" -time=2025-02-19T08:25:01.738+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:01.738+09:00 level=DEBUG msg=Connector.Connect conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:25:01.742+09:00 level=ERROR msg=Connector.Connect conn_id=GcehcYURvlj4lPDG duration=3507917 error="driver: bad connection" -time=2025-02-19T08:25:01.742+09:00 level=ERROR msg=Connector.Connect duration=3641417 error="driver: bad connection" -time=2025-02-19T08:25:03.743+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:03.743+09:00 level=DEBUG msg=Connector.Connect conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:25:03.747+09:00 level=ERROR msg=Connector.Connect conn_id=GcehcYURvlj4lPDG duration=3340041 error="driver: bad connection" -time=2025-02-19T08:25:03.747+09:00 level=ERROR msg=Connector.Connect duration=3583292 error="driver: bad connection" -time=2025-02-19T08:25:03.747+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:03.747+09:00 level=DEBUG msg=Connector.Connect conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:25:03.750+09:00 level=ERROR msg=Connector.Connect conn_id=GcehcYURvlj4lPDG duration=2590291 error="driver: bad connection" -time=2025-02-19T08:25:03.750+09:00 level=ERROR msg=Connector.Connect duration=2747792 error="driver: bad connection" -time=2025-02-19T08:25:03.750+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:03.750+09:00 level=DEBUG msg=Connector.Connect conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:25:03.752+09:00 level=ERROR msg=Connector.Connect conn_id=GcehcYURvlj4lPDG duration=1661208 error="driver: bad connection" -time=2025-02-19T08:25:03.752+09:00 level=ERROR msg=Connector.Connect duration=1868625 error="driver: bad connection" -time=2025-02-19T08:25:05.753+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:05.753+09:00 level=DEBUG msg=Connector.Connect conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:25:05.757+09:00 level=INFO msg=Connector.Connect conn_id=GcehcYURvlj4lPDG duration=4553417 -time=2025-02-19T08:25:05.757+09:00 level=INFO msg=Connector.Connect duration=4614041 -time=2025-02-19T08:25:05.758+09:00 level=DEBUG msg=Conn.ExecContext conn_id=GcehcYURvlj4lPDG query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-02-19T08:25:05.774+09:00 level=INFO msg=Conn.ExecContext conn_id=GcehcYURvlj4lPDG query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=15872083 -time=2025-02-19T08:25:05.774+09:00 level=DEBUG msg=Conn.BeginTx conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:25:05.774+09:00 level=INFO msg=Conn.BeginTx conn_id=GcehcYURvlj4lPDG duration=311917 tx_id=P_5GU9YZ66Q7cVCQ -time=2025-02-19T08:25:05.774+09:00 level=DEBUG msg=Conn.ExecContext conn_id=GcehcYURvlj4lPDG query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" -time=2025-02-19T08:25:05.775+09:00 level=INFO msg=Conn.ExecContext conn_id=GcehcYURvlj4lPDG query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=375 skip=true -time=2025-02-19T08:25:05.775+09:00 level=DEBUG msg=Conn.PrepareContext conn_id=GcehcYURvlj4lPDG query="INSERT INTO test1 (id, name) VALUES (?, ?)" -time=2025-02-19T08:25:05.776+09:00 level=INFO msg=Conn.PrepareContext conn_id=GcehcYURvlj4lPDG query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=1626541 stmt_id=nAPIE1kqEGIjsNpe -time=2025-02-19T08:25:05.776+09:00 level=DEBUG msg=Stmt.ExecContext conn_id=GcehcYURvlj4lPDG stmt_id=nAPIE1kqEGIjsNpe args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" -time=2025-02-19T08:25:05.777+09:00 level=INFO msg=Stmt.ExecContext conn_id=GcehcYURvlj4lPDG stmt_id=nAPIE1kqEGIjsNpe args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=349958 -time=2025-02-19T08:25:05.777+09:00 level=DEBUG msg=Stmt.Close conn_id=GcehcYURvlj4lPDG stmt_id=nAPIE1kqEGIjsNpe -time=2025-02-19T08:25:05.777+09:00 level=INFO msg=Stmt.Close conn_id=GcehcYURvlj4lPDG stmt_id=nAPIE1kqEGIjsNpe duration=4625 -time=2025-02-19T08:25:05.777+09:00 level=DEBUG msg=Tx.Commit conn_id=GcehcYURvlj4lPDG tx_id=P_5GU9YZ66Q7cVCQ -time=2025-02-19T08:25:05.779+09:00 level=INFO msg=Tx.Commit conn_id=GcehcYURvlj4lPDG tx_id=P_5GU9YZ66Q7cVCQ duration=2369584 -time=2025-02-19T08:25:05.779+09:00 level=DEBUG msg=Conn.QueryContext conn_id=GcehcYURvlj4lPDG query="SELECT * FROM test1" args=[] duration=348542 -time=2025-02-19T08:25:05.779+09:00 level=DEBUG msg=Rows.Next conn_id=GcehcYURvlj4lPDG duration=13333 eof=false -time=2025-02-19T08:25:05.779+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:25:05.779+09:00 level=DEBUG msg=Rows.Next conn_id=GcehcYURvlj4lPDG duration=83 eof=true -time=2025-02-19T08:25:05.779+09:00 level=DEBUG msg=Rows.Close conn_id=GcehcYURvlj4lPDG duration=125 -time=2025-02-19T08:25:05.779+09:00 level=DEBUG msg=Conn.Close conn_id=GcehcYURvlj4lPDG -time=2025-02-19T08:25:05.779+09:00 level=INFO msg=Conn.Close conn_id=GcehcYURvlj4lPDG duration=18083 +time=2025-08-06T22:40:48.812+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=2333 conn_id=qhQzjf98qOFNJdgL +time=2025-08-06T22:40:48.812+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=172542 +time=2025-08-06T22:40:48.813+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=1652416 error="driver: bad connection" +time=2025-08-06T22:40:48.813+09:00 level=ERROR msg=Connector.Connect duration=1675375 error="driver: bad connection" +time=2025-08-06T22:40:48.814+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=467125 error="driver: bad connection" +time=2025-08-06T22:40:48.814+09:00 level=ERROR msg=Connector.Connect duration=476000 error="driver: bad connection" +time=2025-08-06T22:40:48.814+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=361667 error="driver: bad connection" +time=2025-08-06T22:40:48.814+09:00 level=ERROR msg=Connector.Connect duration=375208 error="driver: bad connection" +time=2025-08-06T22:40:50.819+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=2992875 error="driver: bad connection" +time=2025-08-06T22:40:50.819+09:00 level=ERROR msg=Connector.Connect duration=3249625 error="driver: bad connection" +time=2025-08-06T22:40:50.821+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=1743208 error="driver: bad connection" +time=2025-08-06T22:40:50.821+09:00 level=ERROR msg=Connector.Connect duration=1812375 error="driver: bad connection" +time=2025-08-06T22:40:50.822+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=1459584 error="driver: bad connection" +time=2025-08-06T22:40:50.822+09:00 level=ERROR msg=Connector.Connect duration=1549541 error="driver: bad connection" +time=2025-08-06T22:40:52.825+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=1326000 error="driver: bad connection" +time=2025-08-06T22:40:52.825+09:00 level=ERROR msg=Connector.Connect duration=1407584 error="driver: bad connection" +time=2025-08-06T22:40:52.826+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=719750 error="driver: bad connection" +time=2025-08-06T22:40:52.826+09:00 level=ERROR msg=Connector.Connect duration=817417 error="driver: bad connection" +time=2025-08-06T22:40:52.827+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=1094750 error="driver: bad connection" +time=2025-08-06T22:40:52.827+09:00 level=ERROR msg=Connector.Connect duration=1135167 error="driver: bad connection" +time=2025-08-06T22:40:54.833+09:00 level=INFO msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=4789125 +time=2025-08-06T22:40:54.833+09:00 level=INFO msg=Connector.Connect duration=4890833 +time=2025-08-06T22:40:54.849+09:00 level=INFO msg=Conn.ExecContext conn_id=qhQzjf98qOFNJdgL query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=15801167 +time=2025-08-06T22:40:54.850+09:00 level=INFO msg=Conn.BeginTx conn_id=qhQzjf98qOFNJdgL duration=204125 tx_id=rLlvDtd8PJM9Mj1V +time=2025-08-06T22:40:54.850+09:00 level=INFO msg=Conn.ExecContext conn_id=qhQzjf98qOFNJdgL query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=625 skip=true +time=2025-08-06T22:40:54.852+09:00 level=INFO msg=Conn.PrepareContext conn_id=qhQzjf98qOFNJdgL query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=2058208 stmt_id=i4jPyOnla62ANYON +time=2025-08-06T22:40:54.852+09:00 level=INFO msg=Stmt.ExecContext conn_id=qhQzjf98qOFNJdgL stmt_id=i4jPyOnla62ANYON args="[1,\"Alice\"]" duration=233541 +time=2025-08-06T22:40:54.853+09:00 level=INFO msg=Stmt.Close conn_id=qhQzjf98qOFNJdgL stmt_id=i4jPyOnla62ANYON duration=10625 +time=2025-08-06T22:40:54.855+09:00 level=INFO msg=Tx.Commit conn_id=qhQzjf98qOFNJdgL tx_id=rLlvDtd8PJM9Mj1V duration=2395375 +time=2025-08-06T22:40:54.855+09:00 level=DEBUG msg=Conn.QueryContext conn_id=qhQzjf98qOFNJdgL query="SELECT * FROM test1" args=[] duration=252625 +time=2025-08-06T22:40:54.855+09:00 level=DEBUG msg=Rows.Next conn_id=qhQzjf98qOFNJdgL duration=2750 eof=false +time=2025-08-06T22:40:54.855+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:40:54.855+09:00 level=DEBUG msg=Rows.Next conn_id=qhQzjf98qOFNJdgL duration=166 eof=true +time=2025-08-06T22:40:54.855+09:00 level=DEBUG msg=Rows.Close conn_id=qhQzjf98qOFNJdgL duration=416 +time=2025-08-06T22:40:54.856+09:00 level=INFO msg=Conn.Close conn_id=qhQzjf98qOFNJdgL duration=44834 diff --git a/examples/logs-mysql/results/info-log.txt b/examples/logs-mysql/results/info-log.txt index bf094c4..3fefa02 100644 --- a/examples/logs-mysql/results/info-log.txt +++ b/examples/logs-mysql/results/info-log.txt @@ -1,31 +1,37 @@ -time=2025-02-19T08:24:52.280+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=16208 conn_id=clbVGbfgqOhHOilv -time=2025-02-19T08:24:52.281+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=526584 -time=2025-02-19T08:24:52.284+09:00 level=ERROR msg=Connector.Connect conn_id=clbVGbfgqOhHOilv duration=2823792 error="driver: bad connection" -time=2025-02-19T08:24:52.284+09:00 level=ERROR msg=Connector.Connect duration=2877584 error="driver: bad connection" -time=2025-02-19T08:24:52.289+09:00 level=ERROR msg=Connector.Connect conn_id=clbVGbfgqOhHOilv duration=5037292 error="driver: bad connection" -time=2025-02-19T08:24:52.289+09:00 level=ERROR msg=Connector.Connect duration=5073709 error="driver: bad connection" -time=2025-02-19T08:24:52.290+09:00 level=ERROR msg=Connector.Connect conn_id=clbVGbfgqOhHOilv duration=1040458 error="driver: bad connection" -time=2025-02-19T08:24:52.290+09:00 level=ERROR msg=Connector.Connect duration=1102916 error="driver: bad connection" -time=2025-02-19T08:24:54.292+09:00 level=ERROR msg=Connector.Connect conn_id=clbVGbfgqOhHOilv duration=1334625 error="driver: bad connection" -time=2025-02-19T08:24:54.292+09:00 level=ERROR msg=Connector.Connect duration=1369917 error="driver: bad connection" -time=2025-02-19T08:24:54.293+09:00 level=ERROR msg=Connector.Connect conn_id=clbVGbfgqOhHOilv duration=725208 error="driver: bad connection" -time=2025-02-19T08:24:54.293+09:00 level=ERROR msg=Connector.Connect duration=746541 error="driver: bad connection" -time=2025-02-19T08:24:54.294+09:00 level=ERROR msg=Connector.Connect conn_id=clbVGbfgqOhHOilv duration=747291 error="driver: bad connection" -time=2025-02-19T08:24:54.294+09:00 level=ERROR msg=Connector.Connect duration=832750 error="driver: bad connection" -time=2025-02-19T08:24:56.298+09:00 level=ERROR msg=Connector.Connect conn_id=clbVGbfgqOhHOilv duration=2891250 error="driver: bad connection" -time=2025-02-19T08:24:56.298+09:00 level=ERROR msg=Connector.Connect duration=3038292 error="driver: bad connection" -time=2025-02-19T08:24:56.299+09:00 level=ERROR msg=Connector.Connect conn_id=clbVGbfgqOhHOilv duration=611542 error="driver: bad connection" -time=2025-02-19T08:24:56.299+09:00 level=ERROR msg=Connector.Connect duration=641333 error="driver: bad connection" -time=2025-02-19T08:24:56.300+09:00 level=ERROR msg=Connector.Connect conn_id=clbVGbfgqOhHOilv duration=721334 error="driver: bad connection" -time=2025-02-19T08:24:56.300+09:00 level=ERROR msg=Connector.Connect duration=769250 error="driver: bad connection" -time=2025-02-19T08:24:58.307+09:00 level=INFO msg=Connector.Connect conn_id=clbVGbfgqOhHOilv duration=6212333 -time=2025-02-19T08:24:58.307+09:00 level=INFO msg=Connector.Connect duration=6373000 -time=2025-02-19T08:24:58.328+09:00 level=INFO msg=Conn.ExecContext conn_id=clbVGbfgqOhHOilv query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=20119875 -time=2025-02-19T08:24:58.329+09:00 level=INFO msg=Conn.BeginTx conn_id=clbVGbfgqOhHOilv duration=536667 tx_id=IiNjHHNd_eLrgYyb -time=2025-02-19T08:24:58.330+09:00 level=INFO msg=Conn.ExecContext conn_id=clbVGbfgqOhHOilv query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=1209 skip=true -time=2025-02-19T08:24:58.332+09:00 level=INFO msg=Conn.PrepareContext conn_id=clbVGbfgqOhHOilv query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=2173458 stmt_id=rcBX4pdS0w5Vhglc -time=2025-02-19T08:24:58.333+09:00 level=INFO msg=Stmt.ExecContext conn_id=clbVGbfgqOhHOilv stmt_id=rcBX4pdS0w5Vhglc args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=605208 -time=2025-02-19T08:24:58.333+09:00 level=INFO msg=Stmt.Close conn_id=clbVGbfgqOhHOilv stmt_id=rcBX4pdS0w5Vhglc duration=22709 -time=2025-02-19T08:24:58.335+09:00 level=INFO msg=Tx.Commit conn_id=clbVGbfgqOhHOilv tx_id=IiNjHHNd_eLrgYyb duration=1991750 -time=2025-02-19T08:24:58.335+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:24:58.336+09:00 level=INFO msg=Conn.Close conn_id=clbVGbfgqOhHOilv duration=50083 +time=2025-08-06T22:40:38.842+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=11334 conn_id=A6FXYv78lOwZ8y9n +time=2025-08-06T22:40:38.842+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=1543167 +time=2025-08-06T22:40:38.844+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=2394084 error="driver: bad connection" +time=2025-08-06T22:40:38.844+09:00 level=ERROR msg=Connector.Connect duration=2410333 error="driver: bad connection" +time=2025-08-06T22:40:38.845+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=506417 error="driver: bad connection" +time=2025-08-06T22:40:38.845+09:00 level=ERROR msg=Connector.Connect duration=519667 error="driver: bad connection" +time=2025-08-06T22:40:38.845+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=362417 error="driver: bad connection" +time=2025-08-06T22:40:38.845+09:00 level=ERROR msg=Connector.Connect duration=371083 error="driver: bad connection" +time=2025-08-06T22:40:40.849+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=2862208 error="driver: bad connection" +time=2025-08-06T22:40:40.849+09:00 level=ERROR msg=Connector.Connect duration=3024167 error="driver: bad connection" +time=2025-08-06T22:40:40.852+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=2618458 error="driver: bad connection" +time=2025-08-06T22:40:40.852+09:00 level=ERROR msg=Connector.Connect duration=2717125 error="driver: bad connection" +time=2025-08-06T22:40:40.854+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=1869042 error="driver: bad connection" +time=2025-08-06T22:40:40.854+09:00 level=ERROR msg=Connector.Connect duration=2062375 error="driver: bad connection" +time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=1294625 error="driver: bad connection" +time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect duration=1344917 error="driver: bad connection" +time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=461791 error="driver: bad connection" +time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect duration=485417 error="driver: bad connection" +time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=369500 error="driver: bad connection" +time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect duration=390000 error="driver: bad connection" +time=2025-08-06T22:40:44.861+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=2671958 error="driver: bad connection" +time=2025-08-06T22:40:44.861+09:00 level=ERROR msg=Connector.Connect duration=2859000 error="driver: bad connection" +time=2025-08-06T22:40:44.863+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=1390583 error="driver: bad connection" +time=2025-08-06T22:40:44.863+09:00 level=ERROR msg=Connector.Connect duration=1446709 error="driver: bad connection" +time=2025-08-06T22:40:44.865+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=1884375 error="driver: bad connection" +time=2025-08-06T22:40:44.865+09:00 level=ERROR msg=Connector.Connect duration=1914500 error="driver: bad connection" +time=2025-08-06T22:40:46.869+09:00 level=INFO msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=3110583 +time=2025-08-06T22:40:46.870+09:00 level=INFO msg=Connector.Connect duration=3959167 +time=2025-08-06T22:40:46.886+09:00 level=INFO msg=Conn.ExecContext conn_id=A6FXYv78lOwZ8y9n query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=15618125 +time=2025-08-06T22:40:46.887+09:00 level=INFO msg=Conn.BeginTx conn_id=A6FXYv78lOwZ8y9n duration=258333 tx_id=MIZHAmY0QXNBxX4l +time=2025-08-06T22:40:46.887+09:00 level=INFO msg=Conn.ExecContext conn_id=A6FXYv78lOwZ8y9n query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=667 skip=true +time=2025-08-06T22:40:46.892+09:00 level=INFO msg=Conn.PrepareContext conn_id=A6FXYv78lOwZ8y9n query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=4744791 stmt_id=3annGcQ7kutRe7kw +time=2025-08-06T22:40:46.893+09:00 level=INFO msg=Stmt.ExecContext conn_id=A6FXYv78lOwZ8y9n stmt_id=3annGcQ7kutRe7kw args="[1,\"Alice\"]" duration=503333 +time=2025-08-06T22:40:46.893+09:00 level=INFO msg=Stmt.Close conn_id=A6FXYv78lOwZ8y9n stmt_id=3annGcQ7kutRe7kw duration=8875 +time=2025-08-06T22:40:46.894+09:00 level=INFO msg=Tx.Commit conn_id=A6FXYv78lOwZ8y9n tx_id=MIZHAmY0QXNBxX4l duration=1582416 +time=2025-08-06T22:40:46.895+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:40:46.895+09:00 level=INFO msg=Conn.Close conn_id=A6FXYv78lOwZ8y9n duration=27375 diff --git a/examples/logs-mysql/results/trace-log.txt b/examples/logs-mysql/results/trace-log.txt index 99f7d2d..a17d112 100644 --- a/examples/logs-mysql/results/trace-log.txt +++ b/examples/logs-mysql/results/trace-log.txt @@ -1,75 +1,84 @@ -time=2025-02-19T08:25:07.327+09:00 level=DEBUG msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 -time=2025-02-19T08:25:07.328+09:00 level=DEBUG msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 -time=2025-02-19T08:25:07.328+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=2916 conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:07.328+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=212583 -time=2025-02-19T08:25:07.328+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:07.328+09:00 level=DEBUG msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:07.330+09:00 level=ERROR msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 duration=2366958 error="driver: bad connection" -time=2025-02-19T08:25:07.330+09:00 level=ERROR msg=Connector.Connect duration=2444959 error="driver: bad connection" -time=2025-02-19T08:25:07.330+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:07.330+09:00 level=DEBUG msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:07.331+09:00 level=ERROR msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 duration=616750 error="driver: bad connection" -time=2025-02-19T08:25:07.331+09:00 level=ERROR msg=Connector.Connect duration=649417 error="driver: bad connection" -time=2025-02-19T08:25:07.331+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:07.331+09:00 level=DEBUG msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:07.331+09:00 level=ERROR msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 duration=459750 error="driver: bad connection" -time=2025-02-19T08:25:07.331+09:00 level=ERROR msg=Connector.Connect duration=490750 error="driver: bad connection" -time=2025-02-19T08:25:09.333+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:09.333+09:00 level=DEBUG msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:09.337+09:00 level=ERROR msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 duration=3817458 error="driver: bad connection" -time=2025-02-19T08:25:09.337+09:00 level=ERROR msg=Connector.Connect duration=4031292 error="driver: bad connection" -time=2025-02-19T08:25:09.337+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:09.337+09:00 level=DEBUG msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:09.339+09:00 level=ERROR msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 duration=2189000 error="driver: bad connection" -time=2025-02-19T08:25:09.339+09:00 level=ERROR msg=Connector.Connect duration=2362875 error="driver: bad connection" -time=2025-02-19T08:25:09.339+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:09.339+09:00 level=DEBUG msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:09.341+09:00 level=ERROR msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 duration=1834750 error="driver: bad connection" -time=2025-02-19T08:25:09.341+09:00 level=ERROR msg=Connector.Connect duration=2001917 error="driver: bad connection" -time=2025-02-19T08:25:11.343+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:11.343+09:00 level=DEBUG msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:11.345+09:00 level=ERROR msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 duration=2030375 error="driver: bad connection" -time=2025-02-19T08:25:11.345+09:00 level=ERROR msg=Connector.Connect duration=2132709 error="driver: bad connection" -time=2025-02-19T08:25:11.345+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:11.345+09:00 level=DEBUG msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:11.346+09:00 level=ERROR msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 duration=790917 error="driver: bad connection" -time=2025-02-19T08:25:11.346+09:00 level=ERROR msg=Connector.Connect duration=848959 error="driver: bad connection" -time=2025-02-19T08:25:11.346+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:11.346+09:00 level=DEBUG msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:11.346+09:00 level=ERROR msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 duration=595542 error="driver: bad connection" -time=2025-02-19T08:25:11.346+09:00 level=ERROR msg=Connector.Connect duration=653125 error="driver: bad connection" -time=2025-02-19T08:25:13.347+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:13.347+09:00 level=DEBUG msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:13.353+09:00 level=INFO msg=Connector.Connect conn_id=DakzQLN_ilUa3qN8 duration=6077459 -time=2025-02-19T08:25:13.353+09:00 level=INFO msg=Connector.Connect duration=6225750 -time=2025-02-19T08:25:13.354+09:00 level=TRACE msg=Conn.Ping conn_id=DakzQLN_ilUa3qN8 duration=611459 -time=2025-02-19T08:25:13.354+09:00 level=TRACE msg=Conn.ResetSession conn_id=DakzQLN_ilUa3qN8 duration=9000 -time=2025-02-19T08:25:13.354+09:00 level=DEBUG msg=Conn.ExecContext conn_id=DakzQLN_ilUa3qN8 query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-02-19T08:25:13.371+09:00 level=INFO msg=Conn.ExecContext conn_id=DakzQLN_ilUa3qN8 query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=16803250 -time=2025-02-19T08:25:13.371+09:00 level=TRACE msg=Conn.ResetSession conn_id=DakzQLN_ilUa3qN8 duration=5583 -time=2025-02-19T08:25:13.371+09:00 level=TRACE msg=Conn.Ping conn_id=DakzQLN_ilUa3qN8 duration=531583 -time=2025-02-19T08:25:13.371+09:00 level=TRACE msg=Conn.ResetSession conn_id=DakzQLN_ilUa3qN8 duration=2667 -time=2025-02-19T08:25:13.371+09:00 level=DEBUG msg=Conn.BeginTx conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:13.372+09:00 level=INFO msg=Conn.BeginTx conn_id=DakzQLN_ilUa3qN8 duration=634875 tx_id=O85OXklLPYwG90t4 -time=2025-02-19T08:25:13.372+09:00 level=DEBUG msg=Conn.ExecContext conn_id=DakzQLN_ilUa3qN8 query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" -time=2025-02-19T08:25:13.372+09:00 level=INFO msg=Conn.ExecContext conn_id=DakzQLN_ilUa3qN8 query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=875 skip=true -time=2025-02-19T08:25:13.372+09:00 level=DEBUG msg=Conn.PrepareContext conn_id=DakzQLN_ilUa3qN8 query="INSERT INTO test1 (id, name) VALUES (?, ?)" -time=2025-02-19T08:25:13.374+09:00 level=INFO msg=Conn.PrepareContext conn_id=DakzQLN_ilUa3qN8 query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=2129541 stmt_id=uw0QbKVPFpGwALfk -time=2025-02-19T08:25:13.374+09:00 level=DEBUG msg=Stmt.ExecContext conn_id=DakzQLN_ilUa3qN8 stmt_id=uw0QbKVPFpGwALfk args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" -time=2025-02-19T08:25:13.375+09:00 level=INFO msg=Stmt.ExecContext conn_id=DakzQLN_ilUa3qN8 stmt_id=uw0QbKVPFpGwALfk args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=567125 -time=2025-02-19T08:25:13.375+09:00 level=DEBUG msg=Stmt.Close conn_id=DakzQLN_ilUa3qN8 stmt_id=uw0QbKVPFpGwALfk -time=2025-02-19T08:25:13.375+09:00 level=INFO msg=Stmt.Close conn_id=DakzQLN_ilUa3qN8 stmt_id=uw0QbKVPFpGwALfk duration=22292 -time=2025-02-19T08:25:13.375+09:00 level=DEBUG msg=Tx.Commit conn_id=DakzQLN_ilUa3qN8 tx_id=O85OXklLPYwG90t4 -time=2025-02-19T08:25:13.377+09:00 level=INFO msg=Tx.Commit conn_id=DakzQLN_ilUa3qN8 tx_id=O85OXklLPYwG90t4 duration=1819792 -time=2025-02-19T08:25:13.377+09:00 level=TRACE msg=Conn.ResetSession conn_id=DakzQLN_ilUa3qN8 duration=4875 -time=2025-02-19T08:25:13.377+09:00 level=TRACE msg=Conn.QueryContext conn_id=DakzQLN_ilUa3qN8 query="SELECT * FROM test1" args=[] -time=2025-02-19T08:25:13.377+09:00 level=DEBUG msg=Conn.QueryContext conn_id=DakzQLN_ilUa3qN8 query="SELECT * FROM test1" args=[] duration=479541 -time=2025-02-19T08:25:13.377+09:00 level=TRACE msg=Rows.Next conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:13.377+09:00 level=DEBUG msg=Rows.Next conn_id=DakzQLN_ilUa3qN8 duration=42042 eof=false -time=2025-02-19T08:25:13.377+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:25:13.377+09:00 level=TRACE msg=Rows.Next conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:13.377+09:00 level=DEBUG msg=Rows.Next conn_id=DakzQLN_ilUa3qN8 duration=417 eof=true -time=2025-02-19T08:25:13.378+09:00 level=TRACE msg=Rows.Close conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:13.378+09:00 level=DEBUG msg=Rows.Close conn_id=DakzQLN_ilUa3qN8 duration=625 -time=2025-02-19T08:25:13.378+09:00 level=DEBUG msg=Conn.Close conn_id=DakzQLN_ilUa3qN8 -time=2025-02-19T08:25:13.378+09:00 level=INFO msg=Conn.Close conn_id=DakzQLN_ilUa3qN8 duration=55708 +time=2025-08-06T22:40:56.743+09:00 level=TRACE msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 +time=2025-08-06T22:40:56.744+09:00 level=TRACE msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 +time=2025-08-06T22:40:56.744+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=1458 conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:40:56.744+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=43750 +time=2025-08-06T22:40:56.744+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:56.744+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:40:56.746+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=2237042 error="driver: bad connection" +time=2025-08-06T22:40:56.746+09:00 level=ERROR msg=Connector.Connect duration=2288333 error="driver: bad connection" +time=2025-08-06T22:40:56.746+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:56.746+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:40:56.747+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=623708 error="driver: bad connection" +time=2025-08-06T22:40:56.747+09:00 level=ERROR msg=Connector.Connect duration=662500 error="driver: bad connection" +time=2025-08-06T22:40:56.747+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:56.747+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:40:56.747+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=503209 error="driver: bad connection" +time=2025-08-06T22:40:56.747+09:00 level=ERROR msg=Connector.Connect duration=552792 error="driver: bad connection" +time=2025-08-06T22:40:58.748+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:58.749+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:40:58.751+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=2517917 error="driver: bad connection" +time=2025-08-06T22:40:58.751+09:00 level=ERROR msg=Connector.Connect duration=2650833 error="driver: bad connection" +time=2025-08-06T22:40:58.751+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:58.751+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:40:58.753+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1943292 error="driver: bad connection" +time=2025-08-06T22:40:58.753+09:00 level=ERROR msg=Connector.Connect duration=2021625 error="driver: bad connection" +time=2025-08-06T22:40:58.753+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:58.753+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:40:58.755+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1519792 error="driver: bad connection" +time=2025-08-06T22:40:58.755+09:00 level=ERROR msg=Connector.Connect duration=1599500 error="driver: bad connection" +time=2025-08-06T22:41:00.756+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:00.756+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:41:00.757+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1327833 error="driver: bad connection" +time=2025-08-06T22:41:00.757+09:00 level=ERROR msg=Connector.Connect duration=1426625 error="driver: bad connection" +time=2025-08-06T22:41:00.757+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:00.757+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:41:00.758+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=785333 error="driver: bad connection" +time=2025-08-06T22:41:00.758+09:00 level=ERROR msg=Connector.Connect duration=834084 error="driver: bad connection" +time=2025-08-06T22:41:00.758+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:00.758+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:41:00.758+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=388834 error="driver: bad connection" +time=2025-08-06T22:41:00.758+09:00 level=ERROR msg=Connector.Connect duration=428166 error="driver: bad connection" +time=2025-08-06T22:41:02.760+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:02.760+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:41:02.762+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1888375 error="driver: bad connection" +time=2025-08-06T22:41:02.762+09:00 level=ERROR msg=Connector.Connect duration=2027250 error="driver: bad connection" +time=2025-08-06T22:41:02.762+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:02.762+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:41:02.763+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1337959 error="driver: bad connection" +time=2025-08-06T22:41:02.764+09:00 level=ERROR msg=Connector.Connect duration=1406750 error="driver: bad connection" +time=2025-08-06T22:41:02.764+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:02.764+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:41:02.765+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1216542 error="driver: bad connection" +time=2025-08-06T22:41:02.765+09:00 level=ERROR msg=Connector.Connect duration=1287500 error="driver: bad connection" +time=2025-08-06T22:41:04.766+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:04.766+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:41:04.769+09:00 level=INFO msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=3320875 +time=2025-08-06T22:41:04.769+09:00 level=INFO msg=Connector.Connect duration=3370250 +time=2025-08-06T22:41:04.770+09:00 level=TRACE msg=Conn.Ping conn_id=ZmYjSEmgE8rqULQF duration=591917 +time=2025-08-06T22:41:04.770+09:00 level=TRACE msg=Conn.ResetSession conn_id=ZmYjSEmgE8rqULQF duration=2750 +time=2025-08-06T22:41:04.770+09:00 level=TRACE msg=Conn.ExecContext conn_id=ZmYjSEmgE8rqULQF query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T22:41:04.787+09:00 level=INFO msg=Conn.ExecContext conn_id=ZmYjSEmgE8rqULQF query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=17286625 +time=2025-08-06T22:41:04.787+09:00 level=TRACE msg=Conn.ResetSession conn_id=ZmYjSEmgE8rqULQF duration=4334 +time=2025-08-06T22:41:04.788+09:00 level=TRACE msg=Conn.Ping conn_id=ZmYjSEmgE8rqULQF duration=375542 +time=2025-08-06T22:41:04.788+09:00 level=TRACE msg=Conn.ResetSession conn_id=ZmYjSEmgE8rqULQF duration=1708 +time=2025-08-06T22:41:04.788+09:00 level=TRACE msg=Conn.BeginTx conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:41:04.788+09:00 level=INFO msg=Conn.BeginTx conn_id=ZmYjSEmgE8rqULQF duration=318708 tx_id=DYa4f8mCkdxdJyp1 +time=2025-08-06T22:41:04.788+09:00 level=TRACE msg=Conn.ExecContext conn_id=ZmYjSEmgE8rqULQF query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" +time=2025-08-06T22:41:04.788+09:00 level=INFO msg=Conn.ExecContext conn_id=ZmYjSEmgE8rqULQF query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=583 skip=true +time=2025-08-06T22:41:04.788+09:00 level=TRACE msg=Conn.PrepareContext conn_id=ZmYjSEmgE8rqULQF query="INSERT INTO test1 (id, name) VALUES (?, ?)" +time=2025-08-06T22:41:04.792+09:00 level=INFO msg=Conn.PrepareContext conn_id=ZmYjSEmgE8rqULQF query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=3755541 stmt_id=dTT5Qw_jeH05OiNu +time=2025-08-06T22:41:04.792+09:00 level=TRACE msg=Stmt.ExecContext conn_id=ZmYjSEmgE8rqULQF stmt_id=dTT5Qw_jeH05OiNu args="[1,\"Alice\"]" +time=2025-08-06T22:41:04.793+09:00 level=INFO msg=Stmt.ExecContext conn_id=ZmYjSEmgE8rqULQF stmt_id=dTT5Qw_jeH05OiNu args="[1,\"Alice\"]" duration=397708 +time=2025-08-06T22:41:04.793+09:00 level=TRACE msg=Stmt.Close conn_id=ZmYjSEmgE8rqULQF stmt_id=dTT5Qw_jeH05OiNu +time=2025-08-06T22:41:04.793+09:00 level=INFO msg=Stmt.Close conn_id=ZmYjSEmgE8rqULQF stmt_id=dTT5Qw_jeH05OiNu duration=14416 +time=2025-08-06T22:41:04.793+09:00 level=TRACE msg=Tx.Commit conn_id=ZmYjSEmgE8rqULQF tx_id=DYa4f8mCkdxdJyp1 +time=2025-08-06T22:41:04.794+09:00 level=INFO msg=Tx.Commit conn_id=ZmYjSEmgE8rqULQF tx_id=DYa4f8mCkdxdJyp1 duration=1512042 +time=2025-08-06T22:41:04.794+09:00 level=TRACE msg=Conn.ResetSession conn_id=ZmYjSEmgE8rqULQF duration=3875 +time=2025-08-06T22:41:04.794+09:00 level=TRACE msg=Conn.QueryContext conn_id=ZmYjSEmgE8rqULQF query="SELECT * FROM test1" args=[] +time=2025-08-06T22:41:04.795+09:00 level=DEBUG msg=Conn.QueryContext conn_id=ZmYjSEmgE8rqULQF query="SELECT * FROM test1" args=[] duration=348334 +time=2025-08-06T22:41:04.795+09:00 level=DEBUG msg=Rows.Next conn_id=ZmYjSEmgE8rqULQF duration=2041 eof=false +time=2025-08-06T22:41:04.795+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:41:04.795+09:00 level=DEBUG msg=Rows.Next conn_id=ZmYjSEmgE8rqULQF duration=125 eof=true +time=2025-08-06T22:41:04.795+09:00 level=DEBUG msg=Rows.Close conn_id=ZmYjSEmgE8rqULQF duration=417 +time=2025-08-06T22:41:04.795+09:00 level=TRACE msg=Conn.Close conn_id=ZmYjSEmgE8rqULQF +time=2025-08-06T22:41:04.795+09:00 level=INFO msg=Conn.Close conn_id=ZmYjSEmgE8rqULQF duration=31208 diff --git a/examples/logs-mysql/results/verbose-log.json b/examples/logs-mysql/results/verbose-log.json index e2ea404..8e3cf21 100644 --- a/examples/logs-mysql/results/verbose-log.json +++ b/examples/logs-mysql/results/verbose-log.json @@ -1,81 +1,93 @@ -{"time":"2025-02-19T08:25:22.45015+09:00","level":"DEBUG","msg":"Open","driver":"mysql","dsn":"root@tcp(localhost:3306)/app1"} -{"time":"2025-02-19T08:25:22.450638+09:00","level":"DEBUG","msg":"Driver.OpenConnector","dsn":"root@tcp(localhost:3306)/app1"} -{"time":"2025-02-19T08:25:22.450681+09:00","level":"INFO","msg":"Driver.OpenConnector","dsn":"root@tcp(localhost:3306)/app1","duration":2708,"conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:22.450706+09:00","level":"INFO","msg":"Open","driver":"mysql","dsn":"root@tcp(localhost:3306)/app1","duration":182875} -{"time":"2025-02-19T08:25:22.450727+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:25:22.450735+09:00","level":"DEBUG","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:22.453242+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF","duration":2482709,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:22.453298+09:00","level":"ERROR","msg":"Connector.Connect","duration":2561208,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:22.45331+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:25:22.453318+09:00","level":"DEBUG","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:22.453978+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF","duration":649750,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:22.454002+09:00","level":"ERROR","msg":"Connector.Connect","duration":682500,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:22.454011+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:25:22.454019+09:00","level":"DEBUG","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:22.454536+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF","duration":498875,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:22.45457+09:00","level":"ERROR","msg":"Connector.Connect","duration":547875,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:24.455673+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:25:24.455858+09:00","level":"DEBUG","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:24.459087+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF","duration":3182625,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:24.459165+09:00","level":"ERROR","msg":"Connector.Connect","duration":3302709,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:24.459186+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:25:24.459205+09:00","level":"DEBUG","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:24.460775+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF","duration":1548959,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:24.460827+09:00","level":"ERROR","msg":"Connector.Connect","duration":1617125,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:24.460847+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:25:24.460864+09:00","level":"DEBUG","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:24.462354+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF","duration":1464833,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:24.462431+09:00","level":"ERROR","msg":"Connector.Connect","duration":1562125,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:26.462813+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:25:26.462986+09:00","level":"DEBUG","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:26.465019+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF","duration":1947209,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:26.465067+09:00","level":"ERROR","msg":"Connector.Connect","duration":2087958,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:26.465105+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:25:26.465112+09:00","level":"DEBUG","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:26.465831+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF","duration":709750,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:26.465895+09:00","level":"ERROR","msg":"Connector.Connect","duration":774417,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:26.465958+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:25:26.465983+09:00","level":"DEBUG","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:26.466559+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF","duration":567167,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:26.466571+09:00","level":"ERROR","msg":"Connector.Connect","duration":587000,"error":"driver: bad connection"} -{"time":"2025-02-19T08:25:28.467657+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:25:28.467778+09:00","level":"DEBUG","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.473066+09:00","level":"INFO","msg":"Connector.Connect","conn_id":"gUAAxHgPxWhrp2JF","duration":5234417} -{"time":"2025-02-19T08:25:28.473163+09:00","level":"INFO","msg":"Connector.Connect","duration":5383875} -{"time":"2025-02-19T08:25:28.473214+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.474065+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"gUAAxHgPxWhrp2JF","duration":822000} -{"time":"2025-02-19T08:25:28.474134+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.474176+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"gUAAxHgPxWhrp2JF","duration":10458} -{"time":"2025-02-19T08:25:28.474222+09:00","level":"DEBUG","msg":"Conn.ExecContext","conn_id":"gUAAxHgPxWhrp2JF","query":"CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))","args":"[]"} -{"time":"2025-02-19T08:25:28.494326+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"gUAAxHgPxWhrp2JF","query":"CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":20028084} -{"time":"2025-02-19T08:25:28.494417+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.494459+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"gUAAxHgPxWhrp2JF","duration":12500} -{"time":"2025-02-19T08:25:28.494483+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.495083+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"gUAAxHgPxWhrp2JF","duration":579417} -{"time":"2025-02-19T08:25:28.495116+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.495138+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"gUAAxHgPxWhrp2JF","duration":4709} -{"time":"2025-02-19T08:25:28.495162+09:00","level":"DEBUG","msg":"Conn.BeginTx","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.495746+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"gUAAxHgPxWhrp2JF","duration":561708,"tx_id":"W46GMOOLwIxg57YM"} -{"time":"2025-02-19T08:25:28.49591+09:00","level":"DEBUG","msg":"Conn.ExecContext","conn_id":"gUAAxHgPxWhrp2JF","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","args":"[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]"} -{"time":"2025-02-19T08:25:28.495946+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"gUAAxHgPxWhrp2JF","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","args":"[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]","duration":1250,"skip":true} -{"time":"2025-02-19T08:25:28.49597+09:00","level":"DEBUG","msg":"Conn.PrepareContext","conn_id":"gUAAxHgPxWhrp2JF","query":"INSERT INTO test1 (id, name) VALUES (?, ?)"} -{"time":"2025-02-19T08:25:28.499284+09:00","level":"INFO","msg":"Conn.PrepareContext","conn_id":"gUAAxHgPxWhrp2JF","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","duration":3277250,"stmt_id":"mblHF05jWxqjhG9M"} -{"time":"2025-02-19T08:25:28.499414+09:00","level":"DEBUG","msg":"Stmt.ExecContext","conn_id":"gUAAxHgPxWhrp2JF","stmt_id":"mblHF05jWxqjhG9M","args":"[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]"} -{"time":"2025-02-19T08:25:28.499952+09:00","level":"INFO","msg":"Stmt.ExecContext","conn_id":"gUAAxHgPxWhrp2JF","stmt_id":"mblHF05jWxqjhG9M","args":"[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]","duration":505125} -{"time":"2025-02-19T08:25:28.499986+09:00","level":"DEBUG","msg":"Stmt.Close","conn_id":"gUAAxHgPxWhrp2JF","stmt_id":"mblHF05jWxqjhG9M"} -{"time":"2025-02-19T08:25:28.500029+09:00","level":"INFO","msg":"Stmt.Close","conn_id":"gUAAxHgPxWhrp2JF","stmt_id":"mblHF05jWxqjhG9M","duration":22167} -{"time":"2025-02-19T08:25:28.500063+09:00","level":"DEBUG","msg":"Tx.Commit","conn_id":"gUAAxHgPxWhrp2JF","tx_id":"W46GMOOLwIxg57YM"} -{"time":"2025-02-19T08:25:28.50162+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"gUAAxHgPxWhrp2JF","tx_id":"W46GMOOLwIxg57YM","duration":1531875} -{"time":"2025-02-19T08:25:28.501653+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.501675+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"gUAAxHgPxWhrp2JF","duration":4125} -{"time":"2025-02-19T08:25:28.5017+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"gUAAxHgPxWhrp2JF","query":"SELECT * FROM test1","args":"[]"} -{"time":"2025-02-19T08:25:28.502251+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"gUAAxHgPxWhrp2JF","query":"SELECT * FROM test1","args":"[]","duration":528125} -{"time":"2025-02-19T08:25:28.502278+09:00","level":"TRACE","msg":"Rows.Next","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.502316+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"gUAAxHgPxWhrp2JF","duration":26334,"eof":false} -{"time":"2025-02-19T08:25:28.502362+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} -{"time":"2025-02-19T08:25:28.502378+09:00","level":"TRACE","msg":"Rows.Next","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.502388+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"gUAAxHgPxWhrp2JF","duration":250,"eof":true} -{"time":"2025-02-19T08:25:28.502399+09:00","level":"TRACE","msg":"Rows.Close","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.502407+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"gUAAxHgPxWhrp2JF","duration":500} -{"time":"2025-02-19T08:25:28.502423+09:00","level":"DEBUG","msg":"Conn.Close","conn_id":"gUAAxHgPxWhrp2JF"} -{"time":"2025-02-19T08:25:28.502483+09:00","level":"INFO","msg":"Conn.Close","conn_id":"gUAAxHgPxWhrp2JF","duration":50542} +{"time":"2025-08-06T22:41:16.839039+09:00","level":"TRACE","msg":"Open","driver":"mysql","dsn":"root@tcp(localhost:3306)/app1"} +{"time":"2025-08-06T22:41:16.839214+09:00","level":"TRACE","msg":"Driver.OpenConnector","dsn":"root@tcp(localhost:3306)/app1"} +{"time":"2025-08-06T22:41:16.839221+09:00","level":"INFO","msg":"Driver.OpenConnector","dsn":"root@tcp(localhost:3306)/app1","duration":1584,"conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:16.839225+09:00","level":"INFO","msg":"Open","driver":"mysql","dsn":"root@tcp(localhost:3306)/app1","duration":41916} +{"time":"2025-08-06T22:41:16.839231+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:16.839234+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:16.841579+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":2339042,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:16.841593+09:00","level":"ERROR","msg":"Connector.Connect","duration":2358667,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:16.841599+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:16.841602+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:16.84241+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":794500,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:16.842443+09:00","level":"ERROR","msg":"Connector.Connect","duration":839541,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:16.842455+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:16.842461+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:16.843073+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":605000,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:16.843083+09:00","level":"ERROR","msg":"Connector.Connect","duration":621500,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:18.844242+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:18.84438+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:18.848667+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":4176791,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:18.848851+09:00","level":"ERROR","msg":"Connector.Connect","duration":4464750,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:18.848926+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:18.848962+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:18.851853+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":2856167,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:18.851949+09:00","level":"ERROR","msg":"Connector.Connect","duration":2983709,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:18.852+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:18.852035+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:18.85834+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":6260625,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:18.858435+09:00","level":"ERROR","msg":"Connector.Connect","duration":6396541,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:20.859537+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:20.859558+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:20.860372+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":805083,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:20.860382+09:00","level":"ERROR","msg":"Connector.Connect","duration":822709,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:20.860393+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:20.860396+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:20.860785+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":383250,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:20.860792+09:00","level":"ERROR","msg":"Connector.Connect","duration":395125,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:20.860796+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:20.860799+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:20.861176+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":372667,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:20.861185+09:00","level":"ERROR","msg":"Connector.Connect","duration":384459,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:22.862308+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:22.862505+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:22.86696+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":4369750,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:22.867109+09:00","level":"ERROR","msg":"Connector.Connect","duration":4595209,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:22.867173+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:22.867211+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:22.869814+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":2553458,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:22.869995+09:00","level":"ERROR","msg":"Connector.Connect","duration":2774250,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:22.870057+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:22.870092+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:22.874422+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":4293708,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:22.874533+09:00","level":"ERROR","msg":"Connector.Connect","duration":4436334,"error":"driver: bad connection"} +{"time":"2025-08-06T22:41:24.875716+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:41:24.875863+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.882783+09:00","level":"INFO","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":6851459} +{"time":"2025-08-06T22:41:24.882904+09:00","level":"INFO","msg":"Connector.Connect","duration":7038458} +{"time":"2025-08-06T22:41:24.882953+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.883969+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"qt39X5RgR8WwzW8a","duration":975375} +{"time":"2025-08-06T22:41:24.88406+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.88411+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a","duration":10583} +{"time":"2025-08-06T22:41:24.884148+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"qt39X5RgR8WwzW8a","query":"CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))","args":"[]"} +{"time":"2025-08-06T22:41:24.906928+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"qt39X5RgR8WwzW8a","query":"CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":22720708} +{"time":"2025-08-06T22:41:24.906999+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.907031+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a","duration":7042} +{"time":"2025-08-06T22:41:24.907081+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.907484+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"qt39X5RgR8WwzW8a","duration":381375} +{"time":"2025-08-06T22:41:24.907521+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.907544+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a","duration":3958} +{"time":"2025-08-06T22:41:24.907564+09:00","level":"TRACE","msg":"Conn.BeginTx","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.907901+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"qt39X5RgR8WwzW8a","duration":318916,"tx_id":"NtCOAzYZWvhnrpwP"} +{"time":"2025-08-06T22:41:24.907963+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"qt39X5RgR8WwzW8a","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","args":"[1,\"Alice\"]"} +{"time":"2025-08-06T22:41:24.908004+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"qt39X5RgR8WwzW8a","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","args":"[1,\"Alice\"]","duration":1125,"skip":true} +{"time":"2025-08-06T22:41:24.908022+09:00","level":"TRACE","msg":"Conn.PrepareContext","conn_id":"qt39X5RgR8WwzW8a","query":"INSERT INTO test1 (id, name) VALUES (?, ?)"} +{"time":"2025-08-06T22:41:24.910059+09:00","level":"INFO","msg":"Conn.PrepareContext","conn_id":"qt39X5RgR8WwzW8a","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","duration":1987417,"stmt_id":"0dizLBDA5tePFJsI"} +{"time":"2025-08-06T22:41:24.910119+09:00","level":"TRACE","msg":"Stmt.ExecContext","conn_id":"qt39X5RgR8WwzW8a","stmt_id":"0dizLBDA5tePFJsI","args":"[1,\"Alice\"]"} +{"time":"2025-08-06T22:41:24.91054+09:00","level":"INFO","msg":"Stmt.ExecContext","conn_id":"qt39X5RgR8WwzW8a","stmt_id":"0dizLBDA5tePFJsI","args":"[1,\"Alice\"]","duration":394833} +{"time":"2025-08-06T22:41:24.910588+09:00","level":"TRACE","msg":"Stmt.Close","conn_id":"qt39X5RgR8WwzW8a","stmt_id":"0dizLBDA5tePFJsI"} +{"time":"2025-08-06T22:41:24.91064+09:00","level":"INFO","msg":"Stmt.Close","conn_id":"qt39X5RgR8WwzW8a","stmt_id":"0dizLBDA5tePFJsI","duration":25000} +{"time":"2025-08-06T22:41:24.910674+09:00","level":"TRACE","msg":"Tx.Commit","conn_id":"qt39X5RgR8WwzW8a","tx_id":"NtCOAzYZWvhnrpwP"} +{"time":"2025-08-06T22:41:24.912286+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"qt39X5RgR8WwzW8a","tx_id":"NtCOAzYZWvhnrpwP","duration":1573458} +{"time":"2025-08-06T22:41:24.912342+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.91236+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a","duration":3917} +{"time":"2025-08-06T22:41:24.912406+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"qt39X5RgR8WwzW8a","query":"SELECT * FROM test1","args":"[]"} +{"time":"2025-08-06T22:41:24.912819+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"qt39X5RgR8WwzW8a","query":"SELECT * FROM test1","args":"[]","duration":396583} +{"time":"2025-08-06T22:41:24.912844+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.912867+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"qt39X5RgR8WwzW8a","duration":3500,"eof":false} +{"time":"2025-08-06T22:41:24.912906+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} +{"time":"2025-08-06T22:41:24.912918+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.912932+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"qt39X5RgR8WwzW8a","duration":209,"eof":true} +{"time":"2025-08-06T22:41:24.912944+09:00","level":"VERBOSE","msg":"Rows.Close","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.912956+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"qt39X5RgR8WwzW8a","duration":541} +{"time":"2025-08-06T22:41:24.912977+09:00","level":"TRACE","msg":"Conn.Close","conn_id":"qt39X5RgR8WwzW8a"} +{"time":"2025-08-06T22:41:24.91305+09:00","level":"INFO","msg":"Conn.Close","conn_id":"qt39X5RgR8WwzW8a","duration":59625} diff --git a/examples/logs-mysql/results/verbose-log.txt b/examples/logs-mysql/results/verbose-log.txt index 763e6a3..193d0f8 100644 --- a/examples/logs-mysql/results/verbose-log.txt +++ b/examples/logs-mysql/results/verbose-log.txt @@ -1,81 +1,93 @@ -time=2025-02-19T08:25:14.804+09:00 level=DEBUG msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 -time=2025-02-19T08:25:14.805+09:00 level=DEBUG msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 -time=2025-02-19T08:25:14.805+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=3250 conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:14.805+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=185541 -time=2025-02-19T08:25:14.805+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:14.805+09:00 level=DEBUG msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:14.808+09:00 level=ERROR msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ duration=3073750 error="driver: bad connection" -time=2025-02-19T08:25:14.808+09:00 level=ERROR msg=Connector.Connect duration=3108791 error="driver: bad connection" -time=2025-02-19T08:25:14.808+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:14.808+09:00 level=DEBUG msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:14.808+09:00 level=ERROR msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ duration=542333 error="driver: bad connection" -time=2025-02-19T08:25:14.808+09:00 level=ERROR msg=Connector.Connect duration=559166 error="driver: bad connection" -time=2025-02-19T08:25:14.808+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:14.808+09:00 level=DEBUG msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:14.809+09:00 level=ERROR msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ duration=497000 error="driver: bad connection" -time=2025-02-19T08:25:14.809+09:00 level=ERROR msg=Connector.Connect duration=507250 error="driver: bad connection" -time=2025-02-19T08:25:16.810+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:16.810+09:00 level=DEBUG msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:16.813+09:00 level=ERROR msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ duration=2465250 error="driver: bad connection" -time=2025-02-19T08:25:16.813+09:00 level=ERROR msg=Connector.Connect duration=2670667 error="driver: bad connection" -time=2025-02-19T08:25:16.813+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:16.813+09:00 level=DEBUG msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:16.814+09:00 level=ERROR msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ duration=1436375 error="driver: bad connection" -time=2025-02-19T08:25:16.815+09:00 level=ERROR msg=Connector.Connect duration=1563333 error="driver: bad connection" -time=2025-02-19T08:25:16.815+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:16.815+09:00 level=DEBUG msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:16.815+09:00 level=ERROR msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ duration=900250 error="driver: bad connection" -time=2025-02-19T08:25:16.816+09:00 level=ERROR msg=Connector.Connect duration=978042 error="driver: bad connection" -time=2025-02-19T08:25:18.817+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:18.817+09:00 level=DEBUG msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:18.819+09:00 level=ERROR msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ duration=2300125 error="driver: bad connection" -time=2025-02-19T08:25:18.819+09:00 level=ERROR msg=Connector.Connect duration=2415375 error="driver: bad connection" -time=2025-02-19T08:25:18.819+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:18.819+09:00 level=DEBUG msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:18.820+09:00 level=ERROR msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ duration=1187042 error="driver: bad connection" -time=2025-02-19T08:25:18.821+09:00 level=ERROR msg=Connector.Connect duration=1267417 error="driver: bad connection" -time=2025-02-19T08:25:18.821+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:18.821+09:00 level=DEBUG msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:18.822+09:00 level=ERROR msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ duration=1109000 error="driver: bad connection" -time=2025-02-19T08:25:18.822+09:00 level=ERROR msg=Connector.Connect duration=1237666 error="driver: bad connection" -time=2025-02-19T08:25:20.823+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:25:20.823+09:00 level=DEBUG msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.827+09:00 level=INFO msg=Connector.Connect conn_id=SU8sW4BPEzVZjdTJ duration=4345958 -time=2025-02-19T08:25:20.827+09:00 level=INFO msg=Connector.Connect duration=4394167 -time=2025-02-19T08:25:20.827+09:00 level=VERBOSE msg=Conn.Ping conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.828+09:00 level=TRACE msg=Conn.Ping conn_id=SU8sW4BPEzVZjdTJ duration=461959 -time=2025-02-19T08:25:20.828+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.828+09:00 level=TRACE msg=Conn.ResetSession conn_id=SU8sW4BPEzVZjdTJ duration=3250 -time=2025-02-19T08:25:20.828+09:00 level=DEBUG msg=Conn.ExecContext conn_id=SU8sW4BPEzVZjdTJ query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-02-19T08:25:20.842+09:00 level=INFO msg=Conn.ExecContext conn_id=SU8sW4BPEzVZjdTJ query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=13984875 -time=2025-02-19T08:25:20.842+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.842+09:00 level=TRACE msg=Conn.ResetSession conn_id=SU8sW4BPEzVZjdTJ duration=1500 -time=2025-02-19T08:25:20.842+09:00 level=VERBOSE msg=Conn.Ping conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.842+09:00 level=TRACE msg=Conn.Ping conn_id=SU8sW4BPEzVZjdTJ duration=439083 -time=2025-02-19T08:25:20.842+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.842+09:00 level=TRACE msg=Conn.ResetSession conn_id=SU8sW4BPEzVZjdTJ duration=1208 -time=2025-02-19T08:25:20.842+09:00 level=DEBUG msg=Conn.BeginTx conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.843+09:00 level=INFO msg=Conn.BeginTx conn_id=SU8sW4BPEzVZjdTJ duration=424916 tx_id=dIFS6F1jIefQfKX7 -time=2025-02-19T08:25:20.843+09:00 level=DEBUG msg=Conn.ExecContext conn_id=SU8sW4BPEzVZjdTJ query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" -time=2025-02-19T08:25:20.843+09:00 level=INFO msg=Conn.ExecContext conn_id=SU8sW4BPEzVZjdTJ query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=459 skip=true -time=2025-02-19T08:25:20.843+09:00 level=DEBUG msg=Conn.PrepareContext conn_id=SU8sW4BPEzVZjdTJ query="INSERT INTO test1 (id, name) VALUES (?, ?)" -time=2025-02-19T08:25:20.845+09:00 level=INFO msg=Conn.PrepareContext conn_id=SU8sW4BPEzVZjdTJ query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=2325417 stmt_id=QINlqBJWBcghK4E1 -time=2025-02-19T08:25:20.845+09:00 level=DEBUG msg=Stmt.ExecContext conn_id=SU8sW4BPEzVZjdTJ stmt_id=QINlqBJWBcghK4E1 args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" -time=2025-02-19T08:25:20.846+09:00 level=INFO msg=Stmt.ExecContext conn_id=SU8sW4BPEzVZjdTJ stmt_id=QINlqBJWBcghK4E1 args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=503416 -time=2025-02-19T08:25:20.846+09:00 level=DEBUG msg=Stmt.Close conn_id=SU8sW4BPEzVZjdTJ stmt_id=QINlqBJWBcghK4E1 -time=2025-02-19T08:25:20.846+09:00 level=INFO msg=Stmt.Close conn_id=SU8sW4BPEzVZjdTJ stmt_id=QINlqBJWBcghK4E1 duration=7500 -time=2025-02-19T08:25:20.846+09:00 level=DEBUG msg=Tx.Commit conn_id=SU8sW4BPEzVZjdTJ tx_id=dIFS6F1jIefQfKX7 -time=2025-02-19T08:25:20.847+09:00 level=INFO msg=Tx.Commit conn_id=SU8sW4BPEzVZjdTJ tx_id=dIFS6F1jIefQfKX7 duration=1531459 -time=2025-02-19T08:25:20.847+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.847+09:00 level=TRACE msg=Conn.ResetSession conn_id=SU8sW4BPEzVZjdTJ duration=1416 -time=2025-02-19T08:25:20.847+09:00 level=TRACE msg=Conn.QueryContext conn_id=SU8sW4BPEzVZjdTJ query="SELECT * FROM test1" args=[] -time=2025-02-19T08:25:20.848+09:00 level=DEBUG msg=Conn.QueryContext conn_id=SU8sW4BPEzVZjdTJ query="SELECT * FROM test1" args=[] duration=552500 -time=2025-02-19T08:25:20.848+09:00 level=TRACE msg=Rows.Next conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.848+09:00 level=DEBUG msg=Rows.Next conn_id=SU8sW4BPEzVZjdTJ duration=19875 eof=false -time=2025-02-19T08:25:20.848+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:25:20.848+09:00 level=TRACE msg=Rows.Next conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.848+09:00 level=DEBUG msg=Rows.Next conn_id=SU8sW4BPEzVZjdTJ duration=250 eof=true -time=2025-02-19T08:25:20.848+09:00 level=TRACE msg=Rows.Close conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.848+09:00 level=DEBUG msg=Rows.Close conn_id=SU8sW4BPEzVZjdTJ duration=333 -time=2025-02-19T08:25:20.848+09:00 level=DEBUG msg=Conn.Close conn_id=SU8sW4BPEzVZjdTJ -time=2025-02-19T08:25:20.848+09:00 level=INFO msg=Conn.Close conn_id=SU8sW4BPEzVZjdTJ duration=20125 +time=2025-08-06T22:41:06.697+09:00 level=TRACE msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 +time=2025-08-06T22:41:06.697+09:00 level=TRACE msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 +time=2025-08-06T22:41:06.697+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=3125 conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:06.697+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=80125 +time=2025-08-06T22:41:06.697+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:06.697+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:06.699+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=2054583 error="driver: bad connection" +time=2025-08-06T22:41:06.699+09:00 level=ERROR msg=Connector.Connect duration=2092041 error="driver: bad connection" +time=2025-08-06T22:41:06.699+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:06.699+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:06.700+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=365625 error="driver: bad connection" +time=2025-08-06T22:41:06.700+09:00 level=ERROR msg=Connector.Connect duration=376625 error="driver: bad connection" +time=2025-08-06T22:41:06.700+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:06.700+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:06.700+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=357250 error="driver: bad connection" +time=2025-08-06T22:41:06.700+09:00 level=ERROR msg=Connector.Connect duration=373833 error="driver: bad connection" +time=2025-08-06T22:41:08.701+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:08.701+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:08.703+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=2005375 error="driver: bad connection" +time=2025-08-06T22:41:08.703+09:00 level=ERROR msg=Connector.Connect duration=2120166 error="driver: bad connection" +time=2025-08-06T22:41:08.704+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:08.704+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:08.706+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=1952833 error="driver: bad connection" +time=2025-08-06T22:41:08.706+09:00 level=ERROR msg=Connector.Connect duration=2155334 error="driver: bad connection" +time=2025-08-06T22:41:08.706+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:08.706+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:08.707+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=1556000 error="driver: bad connection" +time=2025-08-06T22:41:08.708+09:00 level=ERROR msg=Connector.Connect duration=1723916 error="driver: bad connection" +time=2025-08-06T22:41:10.709+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:10.709+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:10.709+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=758125 error="driver: bad connection" +time=2025-08-06T22:41:10.709+09:00 level=ERROR msg=Connector.Connect duration=775250 error="driver: bad connection" +time=2025-08-06T22:41:10.709+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:10.709+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:10.710+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=431292 error="driver: bad connection" +time=2025-08-06T22:41:10.710+09:00 level=ERROR msg=Connector.Connect duration=440083 error="driver: bad connection" +time=2025-08-06T22:41:10.710+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:10.710+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:10.710+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=374375 error="driver: bad connection" +time=2025-08-06T22:41:10.710+09:00 level=ERROR msg=Connector.Connect duration=392875 error="driver: bad connection" +time=2025-08-06T22:41:12.712+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:12.712+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:12.717+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=2988083 error="driver: bad connection" +time=2025-08-06T22:41:12.717+09:00 level=ERROR msg=Connector.Connect duration=5088125 error="driver: bad connection" +time=2025-08-06T22:41:12.718+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:12.718+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:12.720+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=2166791 error="driver: bad connection" +time=2025-08-06T22:41:12.720+09:00 level=ERROR msg=Connector.Connect duration=2395166 error="driver: bad connection" +time=2025-08-06T22:41:12.720+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:12.720+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:12.725+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=4796708 error="driver: bad connection" +time=2025-08-06T22:41:12.725+09:00 level=ERROR msg=Connector.Connect duration=4986792 error="driver: bad connection" +time=2025-08-06T22:41:14.726+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:41:14.727+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.730+09:00 level=INFO msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=3406584 +time=2025-08-06T22:41:14.730+09:00 level=INFO msg=Connector.Connect duration=3437209 +time=2025-08-06T22:41:14.730+09:00 level=VERBOSE msg=Conn.Ping conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.731+09:00 level=TRACE msg=Conn.Ping conn_id=NhccUaPm3A5WfQIu duration=511333 +time=2025-08-06T22:41:14.731+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.731+09:00 level=TRACE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu duration=1708 +time=2025-08-06T22:41:14.731+09:00 level=TRACE msg=Conn.ExecContext conn_id=NhccUaPm3A5WfQIu query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T22:41:14.745+09:00 level=INFO msg=Conn.ExecContext conn_id=NhccUaPm3A5WfQIu query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=14602625 +time=2025-08-06T22:41:14.745+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.745+09:00 level=TRACE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu duration=1583 +time=2025-08-06T22:41:14.745+09:00 level=VERBOSE msg=Conn.Ping conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.745+09:00 level=TRACE msg=Conn.Ping conn_id=NhccUaPm3A5WfQIu duration=133958 +time=2025-08-06T22:41:14.745+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.745+09:00 level=TRACE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu duration=917 +time=2025-08-06T22:41:14.745+09:00 level=TRACE msg=Conn.BeginTx conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.746+09:00 level=INFO msg=Conn.BeginTx conn_id=NhccUaPm3A5WfQIu duration=167334 tx_id=SmI7qj1t8kCCR2SI +time=2025-08-06T22:41:14.746+09:00 level=TRACE msg=Conn.ExecContext conn_id=NhccUaPm3A5WfQIu query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" +time=2025-08-06T22:41:14.746+09:00 level=INFO msg=Conn.ExecContext conn_id=NhccUaPm3A5WfQIu query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=291 skip=true +time=2025-08-06T22:41:14.746+09:00 level=TRACE msg=Conn.PrepareContext conn_id=NhccUaPm3A5WfQIu query="INSERT INTO test1 (id, name) VALUES (?, ?)" +time=2025-08-06T22:41:14.748+09:00 level=INFO msg=Conn.PrepareContext conn_id=NhccUaPm3A5WfQIu query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=2272709 stmt_id=g5K8XWGFNrA_dPJX +time=2025-08-06T22:41:14.748+09:00 level=TRACE msg=Stmt.ExecContext conn_id=NhccUaPm3A5WfQIu stmt_id=g5K8XWGFNrA_dPJX args="[1,\"Alice\"]" +time=2025-08-06T22:41:14.748+09:00 level=INFO msg=Stmt.ExecContext conn_id=NhccUaPm3A5WfQIu stmt_id=g5K8XWGFNrA_dPJX args="[1,\"Alice\"]" duration=201958 +time=2025-08-06T22:41:14.748+09:00 level=TRACE msg=Stmt.Close conn_id=NhccUaPm3A5WfQIu stmt_id=g5K8XWGFNrA_dPJX +time=2025-08-06T22:41:14.748+09:00 level=INFO msg=Stmt.Close conn_id=NhccUaPm3A5WfQIu stmt_id=g5K8XWGFNrA_dPJX duration=4958 +time=2025-08-06T22:41:14.748+09:00 level=TRACE msg=Tx.Commit conn_id=NhccUaPm3A5WfQIu tx_id=SmI7qj1t8kCCR2SI +time=2025-08-06T22:41:14.749+09:00 level=INFO msg=Tx.Commit conn_id=NhccUaPm3A5WfQIu tx_id=SmI7qj1t8kCCR2SI duration=984500 +time=2025-08-06T22:41:14.749+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.749+09:00 level=TRACE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu duration=1125 +time=2025-08-06T22:41:14.749+09:00 level=TRACE msg=Conn.QueryContext conn_id=NhccUaPm3A5WfQIu query="SELECT * FROM test1" args=[] +time=2025-08-06T22:41:14.749+09:00 level=DEBUG msg=Conn.QueryContext conn_id=NhccUaPm3A5WfQIu query="SELECT * FROM test1" args=[] duration=201958 +time=2025-08-06T22:41:14.749+09:00 level=VERBOSE msg=Rows.Next conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.749+09:00 level=DEBUG msg=Rows.Next conn_id=NhccUaPm3A5WfQIu duration=1083 eof=false +time=2025-08-06T22:41:14.749+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:41:14.749+09:00 level=VERBOSE msg=Rows.Next conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.749+09:00 level=DEBUG msg=Rows.Next conn_id=NhccUaPm3A5WfQIu duration=83 eof=true +time=2025-08-06T22:41:14.749+09:00 level=VERBOSE msg=Rows.Close conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.749+09:00 level=DEBUG msg=Rows.Close conn_id=NhccUaPm3A5WfQIu duration=84 +time=2025-08-06T22:41:14.749+09:00 level=TRACE msg=Conn.Close conn_id=NhccUaPm3A5WfQIu +time=2025-08-06T22:41:14.749+09:00 level=INFO msg=Conn.Close conn_id=NhccUaPm3A5WfQIu duration=13833 diff --git a/examples/logs-postgres/results/debug-log.txt b/examples/logs-postgres/results/debug-log.txt index e27c9ba..b21510c 100644 --- a/examples/logs-postgres/results/debug-log.txt +++ b/examples/logs-postgres/results/debug-log.txt @@ -1,25 +1,15 @@ -time=2025-02-19T08:24:40.817+09:00 level=DEBUG msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-02-19T08:24:40.817+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=45083 -time=2025-02-19T08:24:40.817+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:40.817+09:00 level=DEBUG msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-02-19T08:24:40.818+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=954417 error=EOF -time=2025-02-19T08:24:40.818+09:00 level=ERROR msg=Connector.Connect duration=1010458 error=EOF -time=2025-02-19T08:24:42.819+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:42.820+09:00 level=DEBUG msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-02-19T08:24:42.833+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=12936959 conn_id=61Ugc1c8J8pgxWj8 -time=2025-02-19T08:24:42.833+09:00 level=INFO msg=Connector.Connect duration=13163125 -time=2025-02-19T08:24:42.833+09:00 level=DEBUG msg=Conn.ExecContext conn_id=61Ugc1c8J8pgxWj8 query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-02-19T08:24:42.838+09:00 level=INFO msg=Conn.ExecContext conn_id=61Ugc1c8J8pgxWj8 query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=4154125 -time=2025-02-19T08:24:42.838+09:00 level=DEBUG msg=Conn.BeginTx conn_id=61Ugc1c8J8pgxWj8 -time=2025-02-19T08:24:42.839+09:00 level=INFO msg=Conn.BeginTx conn_id=61Ugc1c8J8pgxWj8 duration=617709 tx_id=IalT4gLBWJxi4jbm -time=2025-02-19T08:24:42.839+09:00 level=DEBUG msg=Conn.ExecContext conn_id=61Ugc1c8J8pgxWj8 query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" -time=2025-02-19T08:24:42.841+09:00 level=INFO msg=Conn.ExecContext conn_id=61Ugc1c8J8pgxWj8 query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=1545375 -time=2025-02-19T08:24:42.841+09:00 level=DEBUG msg=Tx.Commit conn_id=61Ugc1c8J8pgxWj8 tx_id=IalT4gLBWJxi4jbm -time=2025-02-19T08:24:42.842+09:00 level=INFO msg=Tx.Commit conn_id=61Ugc1c8J8pgxWj8 tx_id=IalT4gLBWJxi4jbm duration=990375 -time=2025-02-19T08:24:42.843+09:00 level=DEBUG msg=Conn.QueryContext conn_id=61Ugc1c8J8pgxWj8 query="SELECT * FROM test1" args=[] duration=631292 -time=2025-02-19T08:24:42.843+09:00 level=DEBUG msg=Rows.Next conn_id=61Ugc1c8J8pgxWj8 duration=2792 eof=false -time=2025-02-19T08:24:42.843+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:24:42.843+09:00 level=DEBUG msg=Rows.Next conn_id=61Ugc1c8J8pgxWj8 duration=1209 eof=true -time=2025-02-19T08:24:42.843+09:00 level=DEBUG msg=Rows.Close conn_id=61Ugc1c8J8pgxWj8 duration=250 -time=2025-02-19T08:24:42.843+09:00 level=DEBUG msg=Conn.Close conn_id=61Ugc1c8J8pgxWj8 -time=2025-02-19T08:24:42.843+09:00 level=INFO msg=Conn.Close conn_id=61Ugc1c8J8pgxWj8 duration=86708 +time=2025-08-06T22:40:27.499+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=23458 +time=2025-08-06T22:40:27.500+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=852166 error="read tcp 127.0.0.1:60341->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T22:40:27.500+09:00 level=ERROR msg=Connector.Connect duration=884416 error="read tcp 127.0.0.1:60341->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T22:40:29.515+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=13052417 conn_id=ZFcUurxb9Qs5tU0L +time=2025-08-06T22:40:29.515+09:00 level=INFO msg=Connector.Connect duration=13224792 +time=2025-08-06T22:40:29.520+09:00 level=INFO msg=Conn.ExecContext conn_id=ZFcUurxb9Qs5tU0L query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=5166416 +time=2025-08-06T22:40:29.521+09:00 level=INFO msg=Conn.BeginTx conn_id=ZFcUurxb9Qs5tU0L duration=270792 tx_id=Lz1tuNPUCXsPMUbn +time=2025-08-06T22:40:29.522+09:00 level=INFO msg=Conn.ExecContext conn_id=ZFcUurxb9Qs5tU0L query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=1217792 +time=2025-08-06T22:40:29.523+09:00 level=INFO msg=Tx.Commit conn_id=ZFcUurxb9Qs5tU0L tx_id=Lz1tuNPUCXsPMUbn duration=702792 +time=2025-08-06T22:40:29.524+09:00 level=DEBUG msg=Conn.QueryContext conn_id=ZFcUurxb9Qs5tU0L query="SELECT * FROM test1" args=[] duration=378208 +time=2025-08-06T22:40:29.524+09:00 level=DEBUG msg=Rows.Next conn_id=ZFcUurxb9Qs5tU0L duration=1917 eof=false +time=2025-08-06T22:40:29.524+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:40:29.524+09:00 level=DEBUG msg=Rows.Next conn_id=ZFcUurxb9Qs5tU0L duration=1208 eof=true +time=2025-08-06T22:40:29.524+09:00 level=DEBUG msg=Rows.Close conn_id=ZFcUurxb9Qs5tU0L duration=292 +time=2025-08-06T22:40:29.524+09:00 level=INFO msg=Conn.Close conn_id=ZFcUurxb9Qs5tU0L duration=26709 diff --git a/examples/logs-postgres/results/info-log.txt b/examples/logs-postgres/results/info-log.txt index 817b634..82057c6 100644 --- a/examples/logs-postgres/results/info-log.txt +++ b/examples/logs-postgres/results/info-log.txt @@ -1,11 +1,11 @@ -time=2025-02-19T08:24:37.992+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=88917 -time=2025-02-19T08:24:37.994+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=1106584 error=EOF -time=2025-02-19T08:24:37.994+09:00 level=ERROR msg=Connector.Connect duration=1177042 error=EOF -time=2025-02-19T08:24:40.012+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=17772500 conn_id=VIccjsFjsJV7w21h -time=2025-02-19T08:24:40.012+09:00 level=INFO msg=Connector.Connect duration=18083208 -time=2025-02-19T08:24:40.018+09:00 level=INFO msg=Conn.ExecContext conn_id=VIccjsFjsJV7w21h query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=4805208 -time=2025-02-19T08:24:40.019+09:00 level=INFO msg=Conn.BeginTx conn_id=VIccjsFjsJV7w21h duration=579334 tx_id=zPkm6sD1QPNBnYWX -time=2025-02-19T08:24:40.021+09:00 level=INFO msg=Conn.ExecContext conn_id=VIccjsFjsJV7w21h query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=1652042 -time=2025-02-19T08:24:40.023+09:00 level=INFO msg=Tx.Commit conn_id=VIccjsFjsJV7w21h tx_id=zPkm6sD1QPNBnYWX duration=1187791 -time=2025-02-19T08:24:40.023+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:24:40.023+09:00 level=INFO msg=Conn.Close conn_id=VIccjsFjsJV7w21h duration=66042 +time=2025-08-06T22:40:24.644+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=229875 +time=2025-08-06T22:40:24.646+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=842917 error="read tcp 127.0.0.1:60337->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T22:40:24.646+09:00 level=ERROR msg=Connector.Connect duration=893667 error="read tcp 127.0.0.1:60337->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T22:40:26.663+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=16437167 conn_id=U4NQPudl0qNw06Hz +time=2025-08-06T22:40:26.663+09:00 level=INFO msg=Connector.Connect duration=16707208 +time=2025-08-06T22:40:26.671+09:00 level=INFO msg=Conn.ExecContext conn_id=U4NQPudl0qNw06Hz query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=5529125 +time=2025-08-06T22:40:26.672+09:00 level=INFO msg=Conn.BeginTx conn_id=U4NQPudl0qNw06Hz duration=381042 tx_id=yerAEJXh4rijpBsd +time=2025-08-06T22:40:26.673+09:00 level=INFO msg=Conn.ExecContext conn_id=U4NQPudl0qNw06Hz query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=1354875 +time=2025-08-06T22:40:26.674+09:00 level=INFO msg=Tx.Commit conn_id=U4NQPudl0qNw06Hz tx_id=yerAEJXh4rijpBsd duration=775292 +time=2025-08-06T22:40:26.675+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:40:26.675+09:00 level=INFO msg=Conn.Close conn_id=U4NQPudl0qNw06Hz duration=28042 diff --git a/examples/logs-postgres/results/trace-log.txt b/examples/logs-postgres/results/trace-log.txt index b5a7985..85bca4a 100644 --- a/examples/logs-postgres/results/trace-log.txt +++ b/examples/logs-postgres/results/trace-log.txt @@ -1,35 +1,32 @@ -time=2025-02-19T08:24:43.639+09:00 level=DEBUG msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-02-19T08:24:43.639+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=63250 -time=2025-02-19T08:24:43.639+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:43.639+09:00 level=DEBUG msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-02-19T08:24:43.640+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=822750 error=EOF -time=2025-02-19T08:24:43.640+09:00 level=ERROR msg=Connector.Connect duration=869666 error=EOF -time=2025-02-19T08:24:45.641+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:45.642+09:00 level=DEBUG msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-02-19T08:24:45.655+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=12805708 conn_id=_Y6P6RDoUv3By5sG -time=2025-02-19T08:24:45.655+09:00 level=INFO msg=Connector.Connect duration=13109083 -time=2025-02-19T08:24:45.656+09:00 level=TRACE msg=Conn.Ping conn_id=_Y6P6RDoUv3By5sG duration=679542 -time=2025-02-19T08:24:45.656+09:00 level=TRACE msg=Conn.ResetSession conn_id=_Y6P6RDoUv3By5sG duration=708 -time=2025-02-19T08:24:45.656+09:00 level=DEBUG msg=Conn.ExecContext conn_id=_Y6P6RDoUv3By5sG query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-02-19T08:24:45.660+09:00 level=INFO msg=Conn.ExecContext conn_id=_Y6P6RDoUv3By5sG query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=4279750 -time=2025-02-19T08:24:45.660+09:00 level=TRACE msg=Conn.ResetSession conn_id=_Y6P6RDoUv3By5sG duration=334 -time=2025-02-19T08:24:45.661+09:00 level=TRACE msg=Conn.Ping conn_id=_Y6P6RDoUv3By5sG duration=648334 -time=2025-02-19T08:24:45.661+09:00 level=TRACE msg=Conn.ResetSession conn_id=_Y6P6RDoUv3By5sG duration=209 -time=2025-02-19T08:24:45.661+09:00 level=DEBUG msg=Conn.BeginTx conn_id=_Y6P6RDoUv3By5sG -time=2025-02-19T08:24:45.661+09:00 level=INFO msg=Conn.BeginTx conn_id=_Y6P6RDoUv3By5sG duration=589750 tx_id=inB6TzL5WgAXGOs6 -time=2025-02-19T08:24:45.662+09:00 level=DEBUG msg=Conn.ExecContext conn_id=_Y6P6RDoUv3By5sG query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" -time=2025-02-19T08:24:45.663+09:00 level=INFO msg=Conn.ExecContext conn_id=_Y6P6RDoUv3By5sG query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=1566625 -time=2025-02-19T08:24:45.663+09:00 level=DEBUG msg=Tx.Commit conn_id=_Y6P6RDoUv3By5sG tx_id=inB6TzL5WgAXGOs6 -time=2025-02-19T08:24:45.664+09:00 level=INFO msg=Tx.Commit conn_id=_Y6P6RDoUv3By5sG tx_id=inB6TzL5WgAXGOs6 duration=1046458 -time=2025-02-19T08:24:45.664+09:00 level=TRACE msg=Conn.ResetSession conn_id=_Y6P6RDoUv3By5sG duration=167 -time=2025-02-19T08:24:45.664+09:00 level=TRACE msg=Conn.QueryContext conn_id=_Y6P6RDoUv3By5sG query="SELECT * FROM test1" args=[] -time=2025-02-19T08:24:45.665+09:00 level=DEBUG msg=Conn.QueryContext conn_id=_Y6P6RDoUv3By5sG query="SELECT * FROM test1" args=[] duration=587375 -time=2025-02-19T08:24:45.665+09:00 level=TRACE msg=Rows.Next conn_id=_Y6P6RDoUv3By5sG -time=2025-02-19T08:24:45.665+09:00 level=DEBUG msg=Rows.Next conn_id=_Y6P6RDoUv3By5sG duration=3458 eof=false -time=2025-02-19T08:24:45.665+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:24:45.665+09:00 level=TRACE msg=Rows.Next conn_id=_Y6P6RDoUv3By5sG -time=2025-02-19T08:24:45.665+09:00 level=DEBUG msg=Rows.Next conn_id=_Y6P6RDoUv3By5sG duration=1125 eof=true -time=2025-02-19T08:24:45.665+09:00 level=TRACE msg=Rows.Close conn_id=_Y6P6RDoUv3By5sG -time=2025-02-19T08:24:45.665+09:00 level=DEBUG msg=Rows.Close conn_id=_Y6P6RDoUv3By5sG duration=416 -time=2025-02-19T08:24:45.665+09:00 level=DEBUG msg=Conn.Close conn_id=_Y6P6RDoUv3By5sG -time=2025-02-19T08:24:45.665+09:00 level=INFO msg=Conn.Close conn_id=_Y6P6RDoUv3By5sG duration=53667 +time=2025-08-06T22:40:30.327+09:00 level=TRACE msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T22:40:30.327+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=13208 +time=2025-08-06T22:40:30.327+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:30.327+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T22:40:30.328+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=524791 error="read tcp 127.0.0.1:60343->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T22:40:30.328+09:00 level=ERROR msg=Connector.Connect duration=553417 error="read tcp 127.0.0.1:60343->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T22:40:32.329+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:32.329+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T22:40:32.340+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=10913667 conn_id=30X84QrXocW6G2sZ +time=2025-08-06T22:40:32.340+09:00 level=INFO msg=Connector.Connect duration=10987750 +time=2025-08-06T22:40:32.341+09:00 level=TRACE msg=Conn.Ping conn_id=30X84QrXocW6G2sZ duration=451959 +time=2025-08-06T22:40:32.341+09:00 level=TRACE msg=Conn.ResetSession conn_id=30X84QrXocW6G2sZ duration=1000 +time=2025-08-06T22:40:32.341+09:00 level=TRACE msg=Conn.ExecContext conn_id=30X84QrXocW6G2sZ query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T22:40:32.345+09:00 level=INFO msg=Conn.ExecContext conn_id=30X84QrXocW6G2sZ query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=4199417 +time=2025-08-06T22:40:32.345+09:00 level=TRACE msg=Conn.ResetSession conn_id=30X84QrXocW6G2sZ duration=417 +time=2025-08-06T22:40:32.346+09:00 level=TRACE msg=Conn.Ping conn_id=30X84QrXocW6G2sZ duration=254500 +time=2025-08-06T22:40:32.346+09:00 level=TRACE msg=Conn.ResetSession conn_id=30X84QrXocW6G2sZ duration=125 +time=2025-08-06T22:40:32.346+09:00 level=TRACE msg=Conn.BeginTx conn_id=30X84QrXocW6G2sZ +time=2025-08-06T22:40:32.346+09:00 level=INFO msg=Conn.BeginTx conn_id=30X84QrXocW6G2sZ duration=217583 tx_id=rZTywSUdDNra9_7h +time=2025-08-06T22:40:32.346+09:00 level=TRACE msg=Conn.ExecContext conn_id=30X84QrXocW6G2sZ query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" +time=2025-08-06T22:40:32.347+09:00 level=INFO msg=Conn.ExecContext conn_id=30X84QrXocW6G2sZ query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=1226083 +time=2025-08-06T22:40:32.347+09:00 level=TRACE msg=Tx.Commit conn_id=30X84QrXocW6G2sZ tx_id=rZTywSUdDNra9_7h +time=2025-08-06T22:40:32.348+09:00 level=INFO msg=Tx.Commit conn_id=30X84QrXocW6G2sZ tx_id=rZTywSUdDNra9_7h duration=623708 +time=2025-08-06T22:40:32.348+09:00 level=TRACE msg=Conn.ResetSession conn_id=30X84QrXocW6G2sZ duration=292 +time=2025-08-06T22:40:32.348+09:00 level=TRACE msg=Conn.QueryContext conn_id=30X84QrXocW6G2sZ query="SELECT * FROM test1" args=[] +time=2025-08-06T22:40:32.349+09:00 level=DEBUG msg=Conn.QueryContext conn_id=30X84QrXocW6G2sZ query="SELECT * FROM test1" args=[] duration=578792 +time=2025-08-06T22:40:32.349+09:00 level=DEBUG msg=Rows.Next conn_id=30X84QrXocW6G2sZ duration=2000 eof=false +time=2025-08-06T22:40:32.349+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:40:32.349+09:00 level=DEBUG msg=Rows.Next conn_id=30X84QrXocW6G2sZ duration=1084 eof=true +time=2025-08-06T22:40:32.349+09:00 level=DEBUG msg=Rows.Close conn_id=30X84QrXocW6G2sZ duration=208 +time=2025-08-06T22:40:32.349+09:00 level=TRACE msg=Conn.Close conn_id=30X84QrXocW6G2sZ +time=2025-08-06T22:40:32.349+09:00 level=INFO msg=Conn.Close conn_id=30X84QrXocW6G2sZ duration=23500 diff --git a/examples/logs-postgres/results/verbose-log.json b/examples/logs-postgres/results/verbose-log.json index fbb4f53..49da644 100644 --- a/examples/logs-postgres/results/verbose-log.json +++ b/examples/logs-postgres/results/verbose-log.json @@ -1,41 +1,41 @@ -{"time":"2025-02-19T08:24:49.319057+09:00","level":"DEBUG","msg":"Open","driver":"postgres","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} -{"time":"2025-02-19T08:24:49.319365+09:00","level":"INFO","msg":"Open","driver":"postgres","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":51125} -{"time":"2025-02-19T08:24:49.319385+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:24:49.31939+09:00","level":"DEBUG","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} -{"time":"2025-02-19T08:24:49.320334+09:00","level":"ERROR","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":933875,"error":"EOF"} -{"time":"2025-02-19T08:24:49.320346+09:00","level":"ERROR","msg":"Connector.Connect","duration":955750,"error":"EOF"} -{"time":"2025-02-19T08:24:51.32145+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:24:51.321759+09:00","level":"DEBUG","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} -{"time":"2025-02-19T08:24:51.337042+09:00","level":"INFO","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":15201500,"conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.337139+09:00","level":"INFO","msg":"Connector.Connect","duration":15421750} -{"time":"2025-02-19T08:24:51.337199+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.337884+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"RxcviMP5EGYzSVUD","duration":652000} -{"time":"2025-02-19T08:24:51.33795+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.337977+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"RxcviMP5EGYzSVUD","duration":917} -{"time":"2025-02-19T08:24:51.338012+09:00","level":"DEBUG","msg":"Conn.ExecContext","conn_id":"RxcviMP5EGYzSVUD","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]"} -{"time":"2025-02-19T08:24:51.342165+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"RxcviMP5EGYzSVUD","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":4128250} -{"time":"2025-02-19T08:24:51.342231+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.34226+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"RxcviMP5EGYzSVUD","duration":500} -{"time":"2025-02-19T08:24:51.342281+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.342862+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"RxcviMP5EGYzSVUD","duration":558833} -{"time":"2025-02-19T08:24:51.342922+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.342951+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"RxcviMP5EGYzSVUD","duration":250} -{"time":"2025-02-19T08:24:51.342979+09:00","level":"DEBUG","msg":"Conn.BeginTx","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.343504+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"RxcviMP5EGYzSVUD","duration":503167,"tx_id":"7qMOih0egKGVtZbB"} -{"time":"2025-02-19T08:24:51.343633+09:00","level":"DEBUG","msg":"Conn.ExecContext","conn_id":"RxcviMP5EGYzSVUD","query":"INSERT INTO test1 (id, name) VALUES ($1,$2);","args":"[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]"} -{"time":"2025-02-19T08:24:51.345108+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"RxcviMP5EGYzSVUD","query":"INSERT INTO test1 (id, name) VALUES ($1,$2);","args":"[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]","duration":1439166} -{"time":"2025-02-19T08:24:51.345176+09:00","level":"DEBUG","msg":"Tx.Commit","conn_id":"RxcviMP5EGYzSVUD","tx_id":"7qMOih0egKGVtZbB"} -{"time":"2025-02-19T08:24:51.346176+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"RxcviMP5EGYzSVUD","tx_id":"7qMOih0egKGVtZbB","duration":962458} -{"time":"2025-02-19T08:24:51.346279+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.346303+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"RxcviMP5EGYzSVUD","duration":208} -{"time":"2025-02-19T08:24:51.346326+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"RxcviMP5EGYzSVUD","query":"SELECT * FROM test1","args":"[]"} -{"time":"2025-02-19T08:24:51.346978+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"RxcviMP5EGYzSVUD","query":"SELECT * FROM test1","args":"[]","duration":633834} -{"time":"2025-02-19T08:24:51.34704+09:00","level":"TRACE","msg":"Rows.Next","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.347071+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"RxcviMP5EGYzSVUD","duration":3125,"eof":false} -{"time":"2025-02-19T08:24:51.347136+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} -{"time":"2025-02-19T08:24:51.347161+09:00","level":"TRACE","msg":"Rows.Next","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.347177+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"RxcviMP5EGYzSVUD","duration":1208,"eof":true} -{"time":"2025-02-19T08:24:51.347195+09:00","level":"TRACE","msg":"Rows.Close","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.347209+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"RxcviMP5EGYzSVUD","duration":209} -{"time":"2025-02-19T08:24:51.347229+09:00","level":"DEBUG","msg":"Conn.Close","conn_id":"RxcviMP5EGYzSVUD"} -{"time":"2025-02-19T08:24:51.34732+09:00","level":"INFO","msg":"Conn.Close","conn_id":"RxcviMP5EGYzSVUD","duration":74625} +{"time":"2025-08-06T22:40:36.017699+09:00","level":"TRACE","msg":"Open","driver":"postgres","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} +{"time":"2025-08-06T22:40:36.017843+09:00","level":"INFO","msg":"Open","driver":"postgres","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":13958} +{"time":"2025-08-06T22:40:36.017849+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:40:36.017856+09:00","level":"TRACE","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} +{"time":"2025-08-06T22:40:36.018562+09:00","level":"ERROR","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":697875,"error":"read tcp 127.0.0.1:60349->127.0.0.1:5432: read: connection reset by peer"} +{"time":"2025-08-06T22:40:36.01858+09:00","level":"ERROR","msg":"Connector.Connect","duration":727583,"error":"read tcp 127.0.0.1:60349->127.0.0.1:5432: read: connection reset by peer"} +{"time":"2025-08-06T22:40:38.018707+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:40:38.018795+09:00","level":"TRACE","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} +{"time":"2025-08-06T22:40:38.02277+09:00","level":"INFO","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":3963625,"conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.022784+09:00","level":"INFO","msg":"Connector.Connect","duration":3996042} +{"time":"2025-08-06T22:40:38.022794+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.022967+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"p5IExrJONBaSJPAk","duration":168208} +{"time":"2025-08-06T22:40:38.022974+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.022977+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk","duration":333} +{"time":"2025-08-06T22:40:38.022981+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"p5IExrJONBaSJPAk","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]"} +{"time":"2025-08-06T22:40:38.024357+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"p5IExrJONBaSJPAk","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":1370917} +{"time":"2025-08-06T22:40:38.024369+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.024373+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk","duration":166} +{"time":"2025-08-06T22:40:38.024377+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.024541+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"p5IExrJONBaSJPAk","duration":160292} +{"time":"2025-08-06T22:40:38.024548+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.024552+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk","duration":125} +{"time":"2025-08-06T22:40:38.024557+09:00","level":"TRACE","msg":"Conn.BeginTx","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.024709+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"p5IExrJONBaSJPAk","duration":148667,"tx_id":"GMkNXpT_hc_gW8yf"} +{"time":"2025-08-06T22:40:38.024725+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"p5IExrJONBaSJPAk","query":"INSERT INTO test1 (id, name) VALUES ($1,$2);","args":"[1,\"Alice\"]"} +{"time":"2025-08-06T22:40:38.025183+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"p5IExrJONBaSJPAk","query":"INSERT INTO test1 (id, name) VALUES ($1,$2);","args":"[1,\"Alice\"]","duration":448041} +{"time":"2025-08-06T22:40:38.025195+09:00","level":"TRACE","msg":"Tx.Commit","conn_id":"p5IExrJONBaSJPAk","tx_id":"GMkNXpT_hc_gW8yf"} +{"time":"2025-08-06T22:40:38.025433+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"p5IExrJONBaSJPAk","tx_id":"GMkNXpT_hc_gW8yf","duration":224708} +{"time":"2025-08-06T22:40:38.025437+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.025441+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk","duration":84} +{"time":"2025-08-06T22:40:38.025453+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"p5IExrJONBaSJPAk","query":"SELECT * FROM test1","args":"[]"} +{"time":"2025-08-06T22:40:38.025609+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"p5IExrJONBaSJPAk","query":"SELECT * FROM test1","args":"[]","duration":151125} +{"time":"2025-08-06T22:40:38.025615+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.025619+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"p5IExrJONBaSJPAk","duration":750,"eof":false} +{"time":"2025-08-06T22:40:38.025627+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} +{"time":"2025-08-06T22:40:38.02563+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.025633+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"p5IExrJONBaSJPAk","duration":417,"eof":true} +{"time":"2025-08-06T22:40:38.025636+09:00","level":"VERBOSE","msg":"Rows.Close","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.025638+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"p5IExrJONBaSJPAk","duration":84} +{"time":"2025-08-06T22:40:38.025642+09:00","level":"TRACE","msg":"Conn.Close","conn_id":"p5IExrJONBaSJPAk"} +{"time":"2025-08-06T22:40:38.025655+09:00","level":"INFO","msg":"Conn.Close","conn_id":"p5IExrJONBaSJPAk","duration":9750} diff --git a/examples/logs-postgres/results/verbose-log.txt b/examples/logs-postgres/results/verbose-log.txt index 01d0aad..11c8dff 100644 --- a/examples/logs-postgres/results/verbose-log.txt +++ b/examples/logs-postgres/results/verbose-log.txt @@ -1,41 +1,41 @@ -time=2025-02-19T08:24:46.479+09:00 level=DEBUG msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-02-19T08:24:46.479+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=67250 -time=2025-02-19T08:24:46.479+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:46.479+09:00 level=DEBUG msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-02-19T08:24:46.480+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=1015500 error=EOF -time=2025-02-19T08:24:46.480+09:00 level=ERROR msg=Connector.Connect duration=1076958 error=EOF -time=2025-02-19T08:24:48.481+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:48.482+09:00 level=DEBUG msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-02-19T08:24:48.495+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=13364584 conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.495+09:00 level=INFO msg=Connector.Connect duration=13645166 -time=2025-02-19T08:24:48.495+09:00 level=VERBOSE msg=Conn.Ping conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.496+09:00 level=TRACE msg=Conn.Ping conn_id=8Y6397a_miS2KVZ8 duration=741083 -time=2025-02-19T08:24:48.496+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.496+09:00 level=TRACE msg=Conn.ResetSession conn_id=8Y6397a_miS2KVZ8 duration=959 -time=2025-02-19T08:24:48.496+09:00 level=DEBUG msg=Conn.ExecContext conn_id=8Y6397a_miS2KVZ8 query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-02-19T08:24:48.500+09:00 level=INFO msg=Conn.ExecContext conn_id=8Y6397a_miS2KVZ8 query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=4228208 -time=2025-02-19T08:24:48.501+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.501+09:00 level=TRACE msg=Conn.ResetSession conn_id=8Y6397a_miS2KVZ8 duration=459 -time=2025-02-19T08:24:48.501+09:00 level=VERBOSE msg=Conn.Ping conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.501+09:00 level=TRACE msg=Conn.Ping conn_id=8Y6397a_miS2KVZ8 duration=686792 -time=2025-02-19T08:24:48.501+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.501+09:00 level=TRACE msg=Conn.ResetSession conn_id=8Y6397a_miS2KVZ8 duration=500 -time=2025-02-19T08:24:48.501+09:00 level=DEBUG msg=Conn.BeginTx conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.502+09:00 level=INFO msg=Conn.BeginTx conn_id=8Y6397a_miS2KVZ8 duration=603250 tx_id=m7rRA81L0yMj7oAg -time=2025-02-19T08:24:48.502+09:00 level=DEBUG msg=Conn.ExecContext conn_id=8Y6397a_miS2KVZ8 query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" -time=2025-02-19T08:24:48.504+09:00 level=INFO msg=Conn.ExecContext conn_id=8Y6397a_miS2KVZ8 query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[{Name: Ordinal:1 Value:1} {Name: Ordinal:2 Value:Alice}]" duration=1624125 -time=2025-02-19T08:24:48.504+09:00 level=DEBUG msg=Tx.Commit conn_id=8Y6397a_miS2KVZ8 tx_id=m7rRA81L0yMj7oAg -time=2025-02-19T08:24:48.505+09:00 level=INFO msg=Tx.Commit conn_id=8Y6397a_miS2KVZ8 tx_id=m7rRA81L0yMj7oAg duration=1068542 -time=2025-02-19T08:24:48.505+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.505+09:00 level=TRACE msg=Conn.ResetSession conn_id=8Y6397a_miS2KVZ8 duration=166 -time=2025-02-19T08:24:48.505+09:00 level=TRACE msg=Conn.QueryContext conn_id=8Y6397a_miS2KVZ8 query="SELECT * FROM test1" args=[] -time=2025-02-19T08:24:48.506+09:00 level=DEBUG msg=Conn.QueryContext conn_id=8Y6397a_miS2KVZ8 query="SELECT * FROM test1" args=[] duration=711459 -time=2025-02-19T08:24:48.506+09:00 level=TRACE msg=Rows.Next conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.506+09:00 level=DEBUG msg=Rows.Next conn_id=8Y6397a_miS2KVZ8 duration=3625 eof=false -time=2025-02-19T08:24:48.506+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:24:48.506+09:00 level=TRACE msg=Rows.Next conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.506+09:00 level=DEBUG msg=Rows.Next conn_id=8Y6397a_miS2KVZ8 duration=1417 eof=true -time=2025-02-19T08:24:48.506+09:00 level=TRACE msg=Rows.Close conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.506+09:00 level=DEBUG msg=Rows.Close conn_id=8Y6397a_miS2KVZ8 duration=417 -time=2025-02-19T08:24:48.506+09:00 level=DEBUG msg=Conn.Close conn_id=8Y6397a_miS2KVZ8 -time=2025-02-19T08:24:48.506+09:00 level=INFO msg=Conn.Close conn_id=8Y6397a_miS2KVZ8 duration=75583 +time=2025-08-06T22:40:33.195+09:00 level=TRACE msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T22:40:33.195+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=15292 +time=2025-08-06T22:40:33.195+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:33.195+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T22:40:33.197+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=1542000 error="read tcp 127.0.0.1:60345->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T22:40:33.197+09:00 level=ERROR msg=Connector.Connect duration=1590708 error="read tcp 127.0.0.1:60345->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T22:40:35.198+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:35.198+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T22:40:35.206+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=7551083 conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.206+09:00 level=INFO msg=Connector.Connect duration=7620959 +time=2025-08-06T22:40:35.206+09:00 level=VERBOSE msg=Conn.Ping conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.206+09:00 level=TRACE msg=Conn.Ping conn_id=a585Q3ZDe7vga5RV duration=257542 +time=2025-08-06T22:40:35.206+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.206+09:00 level=TRACE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV duration=625 +time=2025-08-06T22:40:35.206+09:00 level=TRACE msg=Conn.ExecContext conn_id=a585Q3ZDe7vga5RV query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T22:40:35.210+09:00 level=INFO msg=Conn.ExecContext conn_id=a585Q3ZDe7vga5RV query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=4340292 +time=2025-08-06T22:40:35.210+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.210+09:00 level=TRACE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV duration=292 +time=2025-08-06T22:40:35.210+09:00 level=VERBOSE msg=Conn.Ping conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.211+09:00 level=TRACE msg=Conn.Ping conn_id=a585Q3ZDe7vga5RV duration=264083 +time=2025-08-06T22:40:35.211+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.211+09:00 level=TRACE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV duration=208 +time=2025-08-06T22:40:35.211+09:00 level=TRACE msg=Conn.BeginTx conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.211+09:00 level=INFO msg=Conn.BeginTx conn_id=a585Q3ZDe7vga5RV duration=214208 tx_id=rj3Frb9Lcjoq1emJ +time=2025-08-06T22:40:35.211+09:00 level=TRACE msg=Conn.ExecContext conn_id=a585Q3ZDe7vga5RV query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" +time=2025-08-06T22:40:35.212+09:00 level=INFO msg=Conn.ExecContext conn_id=a585Q3ZDe7vga5RV query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=668417 +time=2025-08-06T22:40:35.212+09:00 level=TRACE msg=Tx.Commit conn_id=a585Q3ZDe7vga5RV tx_id=rj3Frb9Lcjoq1emJ +time=2025-08-06T22:40:35.212+09:00 level=INFO msg=Tx.Commit conn_id=a585Q3ZDe7vga5RV tx_id=rj3Frb9Lcjoq1emJ duration=371959 +time=2025-08-06T22:40:35.212+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.212+09:00 level=TRACE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV duration=166 +time=2025-08-06T22:40:35.212+09:00 level=TRACE msg=Conn.QueryContext conn_id=a585Q3ZDe7vga5RV query="SELECT * FROM test1" args=[] +time=2025-08-06T22:40:35.212+09:00 level=DEBUG msg=Conn.QueryContext conn_id=a585Q3ZDe7vga5RV query="SELECT * FROM test1" args=[] duration=316625 +time=2025-08-06T22:40:35.212+09:00 level=VERBOSE msg=Rows.Next conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.212+09:00 level=DEBUG msg=Rows.Next conn_id=a585Q3ZDe7vga5RV duration=4125 eof=false +time=2025-08-06T22:40:35.212+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:40:35.212+09:00 level=VERBOSE msg=Rows.Next conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.212+09:00 level=DEBUG msg=Rows.Next conn_id=a585Q3ZDe7vga5RV duration=750 eof=true +time=2025-08-06T22:40:35.212+09:00 level=VERBOSE msg=Rows.Close conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.212+09:00 level=DEBUG msg=Rows.Close conn_id=a585Q3ZDe7vga5RV duration=125 +time=2025-08-06T22:40:35.213+09:00 level=TRACE msg=Conn.Close conn_id=a585Q3ZDe7vga5RV +time=2025-08-06T22:40:35.213+09:00 level=INFO msg=Conn.Close conn_id=a585Q3ZDe7vga5RV duration=19959 diff --git a/examples/logs-sqlite3/results/debug-log.txt b/examples/logs-sqlite3/results/debug-log.txt index a8423c5..1acc992 100644 --- a/examples/logs-sqlite3/results/debug-log.txt +++ b/examples/logs-sqlite3/results/debug-log.txt @@ -1,21 +1,13 @@ -time=2025-02-19T08:24:36.126+09:00 level=DEBUG msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" -time=2025-02-19T08:24:36.126+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=39584 -time=2025-02-19T08:24:36.126+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:36.126+09:00 level=DEBUG msg=Driver.Open dsn="file::memory:?cache=shared" -time=2025-02-19T08:24:36.127+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=663833 conn_id=v87XIbB1VCtfz8ug -time=2025-02-19T08:24:36.127+09:00 level=INFO msg=Connector.Connect duration=678334 -time=2025-02-19T08:24:36.127+09:00 level=DEBUG msg=Conn.ExecContext conn_id=v87XIbB1VCtfz8ug query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-02-19T08:24:36.127+09:00 level=INFO msg=Conn.ExecContext conn_id=v87XIbB1VCtfz8ug query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=82166 -time=2025-02-19T08:24:36.127+09:00 level=DEBUG msg=Conn.BeginTx conn_id=v87XIbB1VCtfz8ug -time=2025-02-19T08:24:36.127+09:00 level=INFO msg=Conn.BeginTx conn_id=v87XIbB1VCtfz8ug duration=3416 tx_id=_VTpZnAgatTSPBfT -time=2025-02-19T08:24:36.127+09:00 level=DEBUG msg=Conn.ExecContext conn_id=v87XIbB1VCtfz8ug query="INSERT INTO test1 (name) VALUES (?)" args="[{Name: Ordinal:1 Value:Alice}]" -time=2025-02-19T08:24:36.127+09:00 level=INFO msg=Conn.ExecContext conn_id=v87XIbB1VCtfz8ug query="INSERT INTO test1 (name) VALUES (?)" args="[{Name: Ordinal:1 Value:Alice}]" duration=8750 -time=2025-02-19T08:24:36.127+09:00 level=DEBUG msg=Tx.Commit conn_id=v87XIbB1VCtfz8ug tx_id=_VTpZnAgatTSPBfT -time=2025-02-19T08:24:36.127+09:00 level=INFO msg=Tx.Commit conn_id=v87XIbB1VCtfz8ug tx_id=_VTpZnAgatTSPBfT duration=3583 -time=2025-02-19T08:24:36.127+09:00 level=DEBUG msg=Conn.QueryContext conn_id=v87XIbB1VCtfz8ug query="SELECT * FROM test1" args=[] duration=5333 -time=2025-02-19T08:24:36.127+09:00 level=DEBUG msg=Rows.Next conn_id=v87XIbB1VCtfz8ug duration=3083 eof=false -time=2025-02-19T08:24:36.127+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:24:36.127+09:00 level=DEBUG msg=Rows.Next conn_id=v87XIbB1VCtfz8ug duration=1084 eof=true -time=2025-02-19T08:24:36.127+09:00 level=DEBUG msg=Rows.Close conn_id=v87XIbB1VCtfz8ug duration=667 -time=2025-02-19T08:24:36.127+09:00 level=DEBUG msg=Conn.Close conn_id=v87XIbB1VCtfz8ug -time=2025-02-19T08:24:36.127+09:00 level=INFO msg=Conn.Close conn_id=v87XIbB1VCtfz8ug duration=13083 +time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=13875 +time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=121583 conn_id=QT2zNrs9NoJk9sin +time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Connector.Connect duration=130541 +time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Conn.ExecContext conn_id=QT2zNrs9NoJk9sin query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=37542 +time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Conn.BeginTx conn_id=QT2zNrs9NoJk9sin duration=2334 tx_id=0waYiZhjBs845sni +time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Conn.ExecContext conn_id=QT2zNrs9NoJk9sin query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=8333 +time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Tx.Commit conn_id=QT2zNrs9NoJk9sin tx_id=0waYiZhjBs845sni duration=3458 +time=2025-08-06T22:40:20.216+09:00 level=DEBUG msg=Conn.QueryContext conn_id=QT2zNrs9NoJk9sin query="SELECT * FROM test1" args=[] duration=4292 +time=2025-08-06T22:40:20.216+09:00 level=DEBUG msg=Rows.Next conn_id=QT2zNrs9NoJk9sin duration=2458 eof=false +time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:40:20.216+09:00 level=DEBUG msg=Rows.Next conn_id=QT2zNrs9NoJk9sin duration=875 eof=true +time=2025-08-06T22:40:20.216+09:00 level=DEBUG msg=Rows.Close conn_id=QT2zNrs9NoJk9sin duration=417 +time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Conn.Close conn_id=QT2zNrs9NoJk9sin duration=8750 diff --git a/examples/logs-sqlite3/results/info-log.txt b/examples/logs-sqlite3/results/info-log.txt index 36dbcbe..af8c093 100644 --- a/examples/logs-sqlite3/results/info-log.txt +++ b/examples/logs-sqlite3/results/info-log.txt @@ -1,9 +1,9 @@ -time=2025-02-19T08:24:35.795+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=83541 -time=2025-02-19T08:24:35.796+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=775542 conn_id=ADzZnA7LF2v5b3mP -time=2025-02-19T08:24:35.796+09:00 level=INFO msg=Connector.Connect duration=792917 -time=2025-02-19T08:24:35.796+09:00 level=INFO msg=Conn.ExecContext conn_id=ADzZnA7LF2v5b3mP query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=104083 -time=2025-02-19T08:24:35.796+09:00 level=INFO msg=Conn.BeginTx conn_id=ADzZnA7LF2v5b3mP duration=4000 tx_id=vLGluRMv1qL1tBJV -time=2025-02-19T08:24:35.796+09:00 level=INFO msg=Conn.ExecContext conn_id=ADzZnA7LF2v5b3mP query="INSERT INTO test1 (name) VALUES (?)" args="[{Name: Ordinal:1 Value:Alice}]" duration=11417 -time=2025-02-19T08:24:35.796+09:00 level=INFO msg=Tx.Commit conn_id=ADzZnA7LF2v5b3mP tx_id=vLGluRMv1qL1tBJV duration=4291 -time=2025-02-19T08:24:35.796+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:24:35.796+09:00 level=INFO msg=Conn.Close conn_id=ADzZnA7LF2v5b3mP duration=16083 +time=2025-08-06T22:40:20.129+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=169375 +time=2025-08-06T22:40:20.131+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=2116042 conn_id=enw1znVF44WbduVy +time=2025-08-06T22:40:20.131+09:00 level=INFO msg=Connector.Connect duration=2127500 +time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Conn.ExecContext conn_id=enw1znVF44WbduVy query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=53250 +time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Conn.BeginTx conn_id=enw1znVF44WbduVy duration=2167 tx_id=MsNb4eX8x4nkFio7 +time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Conn.ExecContext conn_id=enw1znVF44WbduVy query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=5959 +time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Tx.Commit conn_id=enw1znVF44WbduVy tx_id=MsNb4eX8x4nkFio7 duration=3084 +time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Conn.Close conn_id=enw1znVF44WbduVy duration=9458 diff --git a/examples/logs-sqlite3/results/trace-log.txt b/examples/logs-sqlite3/results/trace-log.txt index 21284fd..cbb206a 100644 --- a/examples/logs-sqlite3/results/trace-log.txt +++ b/examples/logs-sqlite3/results/trace-log.txt @@ -1,27 +1,24 @@ -time=2025-02-19T08:24:36.449+09:00 level=DEBUG msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" -time=2025-02-19T08:24:36.449+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=44000 -time=2025-02-19T08:24:36.449+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:36.449+09:00 level=DEBUG msg=Driver.Open dsn="file::memory:?cache=shared" -time=2025-02-19T08:24:36.450+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=824000 conn_id=Z2Xdab0y_7Oxsh_6 -time=2025-02-19T08:24:36.450+09:00 level=INFO msg=Connector.Connect duration=842500 -time=2025-02-19T08:24:36.450+09:00 level=DEBUG msg=Conn.ExecContext conn_id=Z2Xdab0y_7Oxsh_6 query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-02-19T08:24:36.450+09:00 level=INFO msg=Conn.ExecContext conn_id=Z2Xdab0y_7Oxsh_6 query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=100959 -time=2025-02-19T08:24:36.450+09:00 level=TRACE msg=Conn.ResetSession conn_id=Z2Xdab0y_7Oxsh_6 duration=625 -time=2025-02-19T08:24:36.450+09:00 level=DEBUG msg=Conn.BeginTx conn_id=Z2Xdab0y_7Oxsh_6 -time=2025-02-19T08:24:36.450+09:00 level=INFO msg=Conn.BeginTx conn_id=Z2Xdab0y_7Oxsh_6 duration=4250 tx_id=6nxdO4jBuf6O_pPX -time=2025-02-19T08:24:36.450+09:00 level=DEBUG msg=Conn.ExecContext conn_id=Z2Xdab0y_7Oxsh_6 query="INSERT INTO test1 (name) VALUES (?)" args="[{Name: Ordinal:1 Value:Alice}]" -time=2025-02-19T08:24:36.450+09:00 level=INFO msg=Conn.ExecContext conn_id=Z2Xdab0y_7Oxsh_6 query="INSERT INTO test1 (name) VALUES (?)" args="[{Name: Ordinal:1 Value:Alice}]" duration=11959 -time=2025-02-19T08:24:36.450+09:00 level=DEBUG msg=Tx.Commit conn_id=Z2Xdab0y_7Oxsh_6 tx_id=6nxdO4jBuf6O_pPX -time=2025-02-19T08:24:36.450+09:00 level=INFO msg=Tx.Commit conn_id=Z2Xdab0y_7Oxsh_6 tx_id=6nxdO4jBuf6O_pPX duration=4416 -time=2025-02-19T08:24:36.450+09:00 level=TRACE msg=Conn.ResetSession conn_id=Z2Xdab0y_7Oxsh_6 duration=41 -time=2025-02-19T08:24:36.450+09:00 level=TRACE msg=Conn.QueryContext conn_id=Z2Xdab0y_7Oxsh_6 query="SELECT * FROM test1" args=[] -time=2025-02-19T08:24:36.450+09:00 level=DEBUG msg=Conn.QueryContext conn_id=Z2Xdab0y_7Oxsh_6 query="SELECT * FROM test1" args=[] duration=6833 -time=2025-02-19T08:24:36.450+09:00 level=TRACE msg=Rows.Next conn_id=Z2Xdab0y_7Oxsh_6 -time=2025-02-19T08:24:36.450+09:00 level=DEBUG msg=Rows.Next conn_id=Z2Xdab0y_7Oxsh_6 duration=3625 eof=false -time=2025-02-19T08:24:36.450+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:24:36.450+09:00 level=TRACE msg=Rows.Next conn_id=Z2Xdab0y_7Oxsh_6 -time=2025-02-19T08:24:36.450+09:00 level=DEBUG msg=Rows.Next conn_id=Z2Xdab0y_7Oxsh_6 duration=1333 eof=true -time=2025-02-19T08:24:36.450+09:00 level=TRACE msg=Rows.Close conn_id=Z2Xdab0y_7Oxsh_6 -time=2025-02-19T08:24:36.450+09:00 level=DEBUG msg=Rows.Close conn_id=Z2Xdab0y_7Oxsh_6 duration=709 -time=2025-02-19T08:24:36.450+09:00 level=DEBUG msg=Conn.Close conn_id=Z2Xdab0y_7Oxsh_6 -time=2025-02-19T08:24:36.450+09:00 level=INFO msg=Conn.Close conn_id=Z2Xdab0y_7Oxsh_6 duration=16458 +time=2025-08-06T22:40:20.295+09:00 level=TRACE msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" +time=2025-08-06T22:40:20.295+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=7333 +time=2025-08-06T22:40:20.295+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:20.295+09:00 level=TRACE msg=Driver.Open dsn="file::memory:?cache=shared" +time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=108292 conn_id=Pt8MebJ3B4VArvmW +time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Connector.Connect duration=119708 +time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.ExecContext conn_id=Pt8MebJ3B4VArvmW query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Conn.ExecContext conn_id=Pt8MebJ3B4VArvmW query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=37958 +time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.ResetSession conn_id=Pt8MebJ3B4VArvmW duration=334 +time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.BeginTx conn_id=Pt8MebJ3B4VArvmW +time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Conn.BeginTx conn_id=Pt8MebJ3B4VArvmW duration=2916 tx_id=wmHAPsfoNVDOBciw +time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.ExecContext conn_id=Pt8MebJ3B4VArvmW query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" +time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Conn.ExecContext conn_id=Pt8MebJ3B4VArvmW query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=7834 +time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Tx.Commit conn_id=Pt8MebJ3B4VArvmW tx_id=wmHAPsfoNVDOBciw +time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Tx.Commit conn_id=Pt8MebJ3B4VArvmW tx_id=wmHAPsfoNVDOBciw duration=3167 +time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.ResetSession conn_id=Pt8MebJ3B4VArvmW duration=42 +time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.QueryContext conn_id=Pt8MebJ3B4VArvmW query="SELECT * FROM test1" args=[] +time=2025-08-06T22:40:20.296+09:00 level=DEBUG msg=Conn.QueryContext conn_id=Pt8MebJ3B4VArvmW query="SELECT * FROM test1" args=[] duration=4542 +time=2025-08-06T22:40:20.296+09:00 level=DEBUG msg=Rows.Next conn_id=Pt8MebJ3B4VArvmW duration=2750 eof=false +time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:40:20.296+09:00 level=DEBUG msg=Rows.Next conn_id=Pt8MebJ3B4VArvmW duration=875 eof=true +time=2025-08-06T22:40:20.296+09:00 level=DEBUG msg=Rows.Close conn_id=Pt8MebJ3B4VArvmW duration=541 +time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.Close conn_id=Pt8MebJ3B4VArvmW +time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Conn.Close conn_id=Pt8MebJ3B4VArvmW duration=9708 diff --git a/examples/logs-sqlite3/results/verbose-log.json b/examples/logs-sqlite3/results/verbose-log.json index 00bbd60..eecfe44 100644 --- a/examples/logs-sqlite3/results/verbose-log.json +++ b/examples/logs-sqlite3/results/verbose-log.json @@ -1,29 +1,29 @@ -{"time":"2025-02-19T08:24:37.096351+09:00","level":"DEBUG","msg":"Open","driver":"sqlite3","dsn":"file::memory:?cache=shared"} -{"time":"2025-02-19T08:24:37.096656+09:00","level":"INFO","msg":"Open","driver":"sqlite3","dsn":"file::memory:?cache=shared","duration":47833} -{"time":"2025-02-19T08:24:37.096698+09:00","level":"DEBUG","msg":"Connector.Connect"} -{"time":"2025-02-19T08:24:37.096706+09:00","level":"DEBUG","msg":"Driver.Open","dsn":"file::memory:?cache=shared"} -{"time":"2025-02-19T08:24:37.097456+09:00","level":"INFO","msg":"Driver.Open","dsn":"file::memory:?cache=shared","duration":740708,"conn_id":"Nx415q3F0RGRnLis"} -{"time":"2025-02-19T08:24:37.097465+09:00","level":"INFO","msg":"Connector.Connect","duration":760959} -{"time":"2025-02-19T08:24:37.097474+09:00","level":"DEBUG","msg":"Conn.ExecContext","conn_id":"Nx415q3F0RGRnLis","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]"} -{"time":"2025-02-19T08:24:37.097572+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"Nx415q3F0RGRnLis","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":91667} -{"time":"2025-02-19T08:24:37.09758+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"Nx415q3F0RGRnLis"} -{"time":"2025-02-19T08:24:37.097586+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"Nx415q3F0RGRnLis","duration":541} -{"time":"2025-02-19T08:24:37.097591+09:00","level":"DEBUG","msg":"Conn.BeginTx","conn_id":"Nx415q3F0RGRnLis"} -{"time":"2025-02-19T08:24:37.097599+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"Nx415q3F0RGRnLis","duration":3541,"tx_id":"3ri_Ws3oiqkQuC81"} -{"time":"2025-02-19T08:24:37.097635+09:00","level":"DEBUG","msg":"Conn.ExecContext","conn_id":"Nx415q3F0RGRnLis","query":"INSERT INTO test1 (name) VALUES (?)","args":"[{Name: Ordinal:1 Value:Alice}]"} -{"time":"2025-02-19T08:24:37.097652+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"Nx415q3F0RGRnLis","query":"INSERT INTO test1 (name) VALUES (?)","args":"[{Name: Ordinal:1 Value:Alice}]","duration":8916} -{"time":"2025-02-19T08:24:37.097671+09:00","level":"DEBUG","msg":"Tx.Commit","conn_id":"Nx415q3F0RGRnLis","tx_id":"3ri_Ws3oiqkQuC81"} -{"time":"2025-02-19T08:24:37.09768+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"Nx415q3F0RGRnLis","tx_id":"3ri_Ws3oiqkQuC81","duration":3834} -{"time":"2025-02-19T08:24:37.097685+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"Nx415q3F0RGRnLis"} -{"time":"2025-02-19T08:24:37.09769+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"Nx415q3F0RGRnLis","duration":83} -{"time":"2025-02-19T08:24:37.097696+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"Nx415q3F0RGRnLis","query":"SELECT * FROM test1","args":"[]"} -{"time":"2025-02-19T08:24:37.097706+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"Nx415q3F0RGRnLis","query":"SELECT * FROM test1","args":"[]","duration":5708} -{"time":"2025-02-19T08:24:37.097713+09:00","level":"TRACE","msg":"Rows.Next","conn_id":"Nx415q3F0RGRnLis"} -{"time":"2025-02-19T08:24:37.097722+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"Nx415q3F0RGRnLis","duration":3375,"eof":false} -{"time":"2025-02-19T08:24:37.09774+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} -{"time":"2025-02-19T08:24:37.097745+09:00","level":"TRACE","msg":"Rows.Next","conn_id":"Nx415q3F0RGRnLis"} -{"time":"2025-02-19T08:24:37.097752+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"Nx415q3F0RGRnLis","duration":1167,"eof":true} -{"time":"2025-02-19T08:24:37.097757+09:00","level":"TRACE","msg":"Rows.Close","conn_id":"Nx415q3F0RGRnLis"} -{"time":"2025-02-19T08:24:37.097762+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"Nx415q3F0RGRnLis","duration":708} -{"time":"2025-02-19T08:24:37.097768+09:00","level":"DEBUG","msg":"Conn.Close","conn_id":"Nx415q3F0RGRnLis"} -{"time":"2025-02-19T08:24:37.097787+09:00","level":"INFO","msg":"Conn.Close","conn_id":"Nx415q3F0RGRnLis","duration":14250} +{"time":"2025-08-06T22:40:20.456795+09:00","level":"TRACE","msg":"Open","driver":"sqlite3","dsn":"file::memory:?cache=shared"} +{"time":"2025-08-06T22:40:20.45689+09:00","level":"INFO","msg":"Open","driver":"sqlite3","dsn":"file::memory:?cache=shared","duration":8125} +{"time":"2025-08-06T22:40:20.456898+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T22:40:20.456904+09:00","level":"TRACE","msg":"Driver.Open","dsn":"file::memory:?cache=shared"} +{"time":"2025-08-06T22:40:20.45704+09:00","level":"INFO","msg":"Driver.Open","dsn":"file::memory:?cache=shared","duration":130334,"conn_id":"qgXLkGeBcPcKL2bU"} +{"time":"2025-08-06T22:40:20.457045+09:00","level":"INFO","msg":"Connector.Connect","duration":143500} +{"time":"2025-08-06T22:40:20.457052+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"qgXLkGeBcPcKL2bU","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]"} +{"time":"2025-08-06T22:40:20.457094+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"qgXLkGeBcPcKL2bU","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":38084} +{"time":"2025-08-06T22:40:20.4571+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qgXLkGeBcPcKL2bU"} +{"time":"2025-08-06T22:40:20.457103+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qgXLkGeBcPcKL2bU","duration":333} +{"time":"2025-08-06T22:40:20.457105+09:00","level":"TRACE","msg":"Conn.BeginTx","conn_id":"qgXLkGeBcPcKL2bU"} +{"time":"2025-08-06T22:40:20.45711+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"qgXLkGeBcPcKL2bU","duration":2500,"tx_id":"8AGn9638GIFYlkD9"} +{"time":"2025-08-06T22:40:20.457118+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"qgXLkGeBcPcKL2bU","query":"INSERT INTO test1 (name) VALUES (?)","args":"[\"Alice\"]"} +{"time":"2025-08-06T22:40:20.45713+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"qgXLkGeBcPcKL2bU","query":"INSERT INTO test1 (name) VALUES (?)","args":"[\"Alice\"]","duration":8000} +{"time":"2025-08-06T22:40:20.457136+09:00","level":"TRACE","msg":"Tx.Commit","conn_id":"qgXLkGeBcPcKL2bU","tx_id":"8AGn9638GIFYlkD9"} +{"time":"2025-08-06T22:40:20.457143+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"qgXLkGeBcPcKL2bU","tx_id":"8AGn9638GIFYlkD9","duration":3375} +{"time":"2025-08-06T22:40:20.457146+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qgXLkGeBcPcKL2bU"} +{"time":"2025-08-06T22:40:20.457148+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qgXLkGeBcPcKL2bU","duration":41} +{"time":"2025-08-06T22:40:20.457151+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"qgXLkGeBcPcKL2bU","query":"SELECT * FROM test1","args":"[]"} +{"time":"2025-08-06T22:40:20.457158+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"qgXLkGeBcPcKL2bU","query":"SELECT * FROM test1","args":"[]","duration":4375} +{"time":"2025-08-06T22:40:20.457162+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"qgXLkGeBcPcKL2bU"} +{"time":"2025-08-06T22:40:20.45717+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"qgXLkGeBcPcKL2bU","duration":2583,"eof":false} +{"time":"2025-08-06T22:40:20.457176+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} +{"time":"2025-08-06T22:40:20.457179+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"qgXLkGeBcPcKL2bU"} +{"time":"2025-08-06T22:40:20.457182+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"qgXLkGeBcPcKL2bU","duration":833,"eof":true} +{"time":"2025-08-06T22:40:20.457185+09:00","level":"VERBOSE","msg":"Rows.Close","conn_id":"qgXLkGeBcPcKL2bU"} +{"time":"2025-08-06T22:40:20.457187+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"qgXLkGeBcPcKL2bU","duration":500} +{"time":"2025-08-06T22:40:20.457191+09:00","level":"TRACE","msg":"Conn.Close","conn_id":"qgXLkGeBcPcKL2bU"} +{"time":"2025-08-06T22:40:20.457203+09:00","level":"INFO","msg":"Conn.Close","conn_id":"qgXLkGeBcPcKL2bU","duration":9333} diff --git a/examples/logs-sqlite3/results/verbose-log.txt b/examples/logs-sqlite3/results/verbose-log.txt index 0e90b01..c2f7892 100644 --- a/examples/logs-sqlite3/results/verbose-log.txt +++ b/examples/logs-sqlite3/results/verbose-log.txt @@ -1,29 +1,29 @@ -time=2025-02-19T08:24:36.778+09:00 level=DEBUG msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" -time=2025-02-19T08:24:36.778+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=48834 -time=2025-02-19T08:24:36.778+09:00 level=DEBUG msg=Connector.Connect -time=2025-02-19T08:24:36.778+09:00 level=DEBUG msg=Driver.Open dsn="file::memory:?cache=shared" -time=2025-02-19T08:24:36.779+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=812541 conn_id=DHIaKg4dGsNaJKno -time=2025-02-19T08:24:36.779+09:00 level=INFO msg=Connector.Connect duration=830875 -time=2025-02-19T08:24:36.779+09:00 level=DEBUG msg=Conn.ExecContext conn_id=DHIaKg4dGsNaJKno query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-02-19T08:24:36.779+09:00 level=INFO msg=Conn.ExecContext conn_id=DHIaKg4dGsNaJKno query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=103542 -time=2025-02-19T08:24:36.779+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=DHIaKg4dGsNaJKno -time=2025-02-19T08:24:36.779+09:00 level=TRACE msg=Conn.ResetSession conn_id=DHIaKg4dGsNaJKno duration=708 -time=2025-02-19T08:24:36.779+09:00 level=DEBUG msg=Conn.BeginTx conn_id=DHIaKg4dGsNaJKno -time=2025-02-19T08:24:36.779+09:00 level=INFO msg=Conn.BeginTx conn_id=DHIaKg4dGsNaJKno duration=4166 tx_id=p3TnEFe42_hv1aFr -time=2025-02-19T08:24:36.779+09:00 level=DEBUG msg=Conn.ExecContext conn_id=DHIaKg4dGsNaJKno query="INSERT INTO test1 (name) VALUES (?)" args="[{Name: Ordinal:1 Value:Alice}]" -time=2025-02-19T08:24:36.779+09:00 level=INFO msg=Conn.ExecContext conn_id=DHIaKg4dGsNaJKno query="INSERT INTO test1 (name) VALUES (?)" args="[{Name: Ordinal:1 Value:Alice}]" duration=9750 -time=2025-02-19T08:24:36.779+09:00 level=DEBUG msg=Tx.Commit conn_id=DHIaKg4dGsNaJKno tx_id=p3TnEFe42_hv1aFr -time=2025-02-19T08:24:36.779+09:00 level=INFO msg=Tx.Commit conn_id=DHIaKg4dGsNaJKno tx_id=p3TnEFe42_hv1aFr duration=4375 -time=2025-02-19T08:24:36.779+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=DHIaKg4dGsNaJKno -time=2025-02-19T08:24:36.779+09:00 level=TRACE msg=Conn.ResetSession conn_id=DHIaKg4dGsNaJKno duration=125 -time=2025-02-19T08:24:36.779+09:00 level=TRACE msg=Conn.QueryContext conn_id=DHIaKg4dGsNaJKno query="SELECT * FROM test1" args=[] -time=2025-02-19T08:24:36.779+09:00 level=DEBUG msg=Conn.QueryContext conn_id=DHIaKg4dGsNaJKno query="SELECT * FROM test1" args=[] duration=6583 -time=2025-02-19T08:24:36.779+09:00 level=TRACE msg=Rows.Next conn_id=DHIaKg4dGsNaJKno -time=2025-02-19T08:24:36.779+09:00 level=DEBUG msg=Rows.Next conn_id=DHIaKg4dGsNaJKno duration=3667 eof=false -time=2025-02-19T08:24:36.779+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-02-19T08:24:36.779+09:00 level=TRACE msg=Rows.Next conn_id=DHIaKg4dGsNaJKno -time=2025-02-19T08:24:36.779+09:00 level=DEBUG msg=Rows.Next conn_id=DHIaKg4dGsNaJKno duration=1375 eof=true -time=2025-02-19T08:24:36.779+09:00 level=TRACE msg=Rows.Close conn_id=DHIaKg4dGsNaJKno -time=2025-02-19T08:24:36.779+09:00 level=DEBUG msg=Rows.Close conn_id=DHIaKg4dGsNaJKno duration=833 -time=2025-02-19T08:24:36.779+09:00 level=DEBUG msg=Conn.Close conn_id=DHIaKg4dGsNaJKno -time=2025-02-19T08:24:36.779+09:00 level=INFO msg=Conn.Close conn_id=DHIaKg4dGsNaJKno duration=15958 +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" +time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=7917 +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Driver.Open dsn="file::memory:?cache=shared" +time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=110250 conn_id=CC5HhmOHgOuaxnyw +time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Connector.Connect duration=122333 +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.ExecContext conn_id=CC5HhmOHgOuaxnyw query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Conn.ExecContext conn_id=CC5HhmOHgOuaxnyw query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=37625 +time=2025-08-06T22:40:20.376+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=CC5HhmOHgOuaxnyw +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.ResetSession conn_id=CC5HhmOHgOuaxnyw duration=333 +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.BeginTx conn_id=CC5HhmOHgOuaxnyw +time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Conn.BeginTx conn_id=CC5HhmOHgOuaxnyw duration=2458 tx_id=YkPxtXFLyvViW1Cs +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.ExecContext conn_id=CC5HhmOHgOuaxnyw query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" +time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Conn.ExecContext conn_id=CC5HhmOHgOuaxnyw query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=8083 +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Tx.Commit conn_id=CC5HhmOHgOuaxnyw tx_id=YkPxtXFLyvViW1Cs +time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Tx.Commit conn_id=CC5HhmOHgOuaxnyw tx_id=YkPxtXFLyvViW1Cs duration=3208 +time=2025-08-06T22:40:20.376+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=CC5HhmOHgOuaxnyw +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.ResetSession conn_id=CC5HhmOHgOuaxnyw duration=42 +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.QueryContext conn_id=CC5HhmOHgOuaxnyw query="SELECT * FROM test1" args=[] +time=2025-08-06T22:40:20.376+09:00 level=DEBUG msg=Conn.QueryContext conn_id=CC5HhmOHgOuaxnyw query="SELECT * FROM test1" args=[] duration=4291 +time=2025-08-06T22:40:20.376+09:00 level=VERBOSE msg=Rows.Next conn_id=CC5HhmOHgOuaxnyw +time=2025-08-06T22:40:20.376+09:00 level=DEBUG msg=Rows.Next conn_id=CC5HhmOHgOuaxnyw duration=2500 eof=false +time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T22:40:20.376+09:00 level=VERBOSE msg=Rows.Next conn_id=CC5HhmOHgOuaxnyw +time=2025-08-06T22:40:20.376+09:00 level=DEBUG msg=Rows.Next conn_id=CC5HhmOHgOuaxnyw duration=834 eof=true +time=2025-08-06T22:40:20.376+09:00 level=VERBOSE msg=Rows.Close conn_id=CC5HhmOHgOuaxnyw +time=2025-08-06T22:40:20.376+09:00 level=DEBUG msg=Rows.Close conn_id=CC5HhmOHgOuaxnyw duration=416 +time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.Close conn_id=CC5HhmOHgOuaxnyw +time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Conn.Close conn_id=CC5HhmOHgOuaxnyw duration=9375 From aff5759e1ee171fea8ce85f69f493f69291ad8f2 Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 23:23:01 +0900 Subject: [PATCH 06/11] =?UTF-8?q?=E2=9C=A8=20Modify=20log=20levels=20for?= =?UTF-8?q?=20Conn.PrepareContext=20method=20and=20Stmt=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conn.go | 2 +- stmt.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conn.go b/conn.go index ac19c7d..1e16153 100644 --- a/conn.go +++ b/conn.go @@ -46,7 +46,7 @@ func defaultConnOptions(driverName string, msgb StepEventMsgBuilder) *connOption Close: *defaultStepOptions(msgb, StepConnClose, LevelInfo), Prepare: *defaultStepOptions(msgb, StepConnPrepare, LevelInfo), - PrepareContext: *defaultStepOptions(msgb, StepConnPrepareContext, LevelInfo), + PrepareContext: *defaultStepOptions(msgb, StepConnPrepareContext, LevelTrace), StmtIDKey: StmtIDKeyDefault, StmtOptions: stmtOptions, diff --git a/stmt.go b/stmt.go index 4e30d19..86718e8 100644 --- a/stmt.go +++ b/stmt.go @@ -18,11 +18,11 @@ type stmtOptions struct { func defaultStmtOptions(msgb StepEventMsgBuilder) *stmtOptions { return &stmtOptions{ - Close: *defaultStepOptions(msgb, StepStmtClose, LevelInfo), - Exec: *defaultStepOptions(msgb, StepStmtExec, LevelInfo), - Query: *defaultStepOptions(msgb, StepStmtQuery, LevelInfo), - ExecContext: *defaultStepOptions(msgb, StepStmtExecContext, LevelInfo), - QueryContext: *defaultStepOptions(msgb, StepStmtQueryContext, LevelInfo), + Close: *defaultStepOptions(msgb, StepStmtClose, LevelDebug), + Exec: *defaultStepOptions(msgb, StepStmtExec, LevelDebug), + Query: *defaultStepOptions(msgb, StepStmtQuery, LevelDebug), + ExecContext: *defaultStepOptions(msgb, StepStmtExecContext, LevelDebug), + QueryContext: *defaultStepOptions(msgb, StepStmtQueryContext, LevelDebug), Rows: defaultRowsOptions(msgb), } } From 213fbd2f59053a42c86dd288ddd4db799ac22b5a Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 23:23:33 +0900 Subject: [PATCH 07/11] =?UTF-8?q?=E2=9C=85=20Follow=20log=20level=20modifi?= =?UTF-8?q?cation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/mysql/low_level_with_context_test.go | 84 +++++++++---------- tests/postgres/low_level_with_context_test.go | 36 ++++---- tests/sqlite3/low_level_with_context_test.go | 50 +++++------ .../sqlite3/low_level_without_context_test.go | 52 ++++++------ 4 files changed, 111 insertions(+), 111 deletions(-) diff --git a/tests/mysql/low_level_with_context_test.go b/tests/mysql/low_level_with_context_test.go index 3c44c2c..966723d 100644 --- a/tests/mysql/low_level_with_context_test.go +++ b/tests/mysql/low_level_with_context_test.go @@ -116,8 +116,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) logs.Start() @@ -126,8 +126,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) logs.Start() @@ -139,8 +139,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -159,12 +159,12 @@ func TestLowLevelWithContext(t *testing.T) { {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, "skip": true, connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": "INSERT INTO test1 (id, name) VALUES (?, ?)", connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": "INSERT INTO test1 (id, name) VALUES (?, ?)", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": "INSERT INTO test1 (id, name) VALUES (?, ?)", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": "INSERT INTO test1 (id, name) VALUES (?, ?)", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) logs.Start() @@ -192,10 +192,10 @@ func TestLowLevelWithContext(t *testing.T) { {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.QueryContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.QueryContext Complete", "query": query, "args": args, "skip": true, connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": "SELECT id, name FROM test1 WHERE name LIKE ?", connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": "SELECT id, name FROM test1 WHERE name LIKE ?", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": "SELECT id, name FROM test1 WHERE name LIKE ?", connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": "SELECT id, name FROM test1 WHERE name LIKE ?", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.QueryContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.QueryContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) t.Run("rows.Columns", func(t *testing.T) { @@ -276,8 +276,8 @@ func TestLowLevelWithContext(t *testing.T) { {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": true, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) expectedResults := []map[string]interface{}{ @@ -301,16 +301,16 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) defer func() { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -322,8 +322,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, @@ -342,16 +342,16 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) defer func() { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -362,8 +362,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() assert.NoError(t, err) @@ -395,12 +395,12 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, "skip": true, connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := r.RowsAffected() @@ -439,12 +439,12 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "TRACE", "msg": "Conn.ExecContext Start", "query": query, "args": args, connIDKey: connIDExpected}, {"level": "INFO", "msg": "Conn.ExecContext Complete", "query": query, "args": args, "skip": true, connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := r.RowsAffected() diff --git a/tests/postgres/low_level_with_context_test.go b/tests/postgres/low_level_with_context_test.go index 451cef3..1252dfb 100644 --- a/tests/postgres/low_level_with_context_test.go +++ b/tests/postgres/low_level_with_context_test.go @@ -113,8 +113,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) logs.Start() @@ -123,8 +123,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) logs.Start() @@ -136,8 +136,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -284,16 +284,16 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) defer func() { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -305,8 +305,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, @@ -325,16 +325,16 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) defer func() { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -345,8 +345,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() assert.NoError(t, err) diff --git a/tests/sqlite3/low_level_with_context_test.go b/tests/sqlite3/low_level_with_context_test.go index eeea4c1..9f5ace6 100644 --- a/tests/sqlite3/low_level_with_context_test.go +++ b/tests/sqlite3/low_level_with_context_test.go @@ -104,8 +104,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) logs.Start() @@ -114,8 +114,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) logs.Start() @@ -127,8 +127,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -317,16 +317,16 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) defer func() { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -338,8 +338,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, @@ -357,7 +357,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, {"level": "ERROR", "msg": "Conn.PrepareContext Error", "query": query, "error": "near \"invalid\": syntax error", connIDKey: connIDExpected}, }) }) @@ -371,16 +371,16 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) defer func() { logs.Start() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -392,8 +392,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() assert.NoError(t, err) @@ -407,7 +407,7 @@ func TestLowLevelWithContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "ERROR", "msg": "Stmt.ExecContext Error", "args": args, "error": "datatype mismatch", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -545,8 +545,8 @@ func TestLowLevelWithContext(t *testing.T) { logs.Start() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -573,8 +573,8 @@ func TestLowLevelWithContext(t *testing.T) { assert.NoError(t, err) args := "[4,\"qux\"]" logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Exec Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Exec Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Exec Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Exec Complete", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() assert.NoError(t, err) @@ -586,7 +586,7 @@ func TestLowLevelWithContext(t *testing.T) { assert.Error(t, err) args := "[\"abc\",\"qux\"]" logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Exec Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Exec Start", "args": args, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "ERROR", "msg": "Stmt.Exec Error", "args": args, "error": "datatype mismatch", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) diff --git a/tests/sqlite3/low_level_without_context_test.go b/tests/sqlite3/low_level_without_context_test.go index 7a58d02..c3552d1 100644 --- a/tests/sqlite3/low_level_without_context_test.go +++ b/tests/sqlite3/low_level_without_context_test.go @@ -104,8 +104,8 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) buf.Reset() @@ -114,8 +114,8 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": "[]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) buf.Reset() @@ -127,8 +127,8 @@ func TestLowLevelWithoutContext(t *testing.T) { buf.Reset() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }) @@ -317,16 +317,16 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) defer func() { buf.Reset() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -338,8 +338,8 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.QueryContext Start", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.QueryContext Complete", "args": "[1]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Next Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "DEBUG", "msg": "Rows.Next Complete", "eof": false, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, {"level": "VERBOSE", "msg": "Rows.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, @@ -359,16 +359,16 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) defer func() { buf.Reset() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -379,8 +379,8 @@ func TestLowLevelWithoutContext(t *testing.T) { logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.ExecContext Start", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.ExecContext Complete", "args": "[4,\"qux\"]", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) rowsAffected, err := result.RowsAffected() assert.NoError(t, err) @@ -520,8 +520,8 @@ func TestLowLevelWithoutContext(t *testing.T) { buf.Reset() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -548,8 +548,8 @@ func TestLowLevelWithoutContext(t *testing.T) { buf.Reset() stmt.Close() logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) }() @@ -592,16 +592,16 @@ func TestLowLevelWithoutContext(t *testing.T) { buf.Reset() assert.NoError(t, stmt.Close()) logs.Assert(t, []map[string]interface{}{ - {"level": "TRACE", "msg": "Stmt.Close Start", stmtIDKey: stmtIDExpected, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Stmt.Close Complete", stmtIDKey: stmtIDExpected, connIDKey: connIDExpected}, + {"level": "VERBOSE", "msg": "Stmt.Close Start", stmtIDKey: stmtIDExpected, connIDKey: connIDExpected}, + {"level": "DEBUG", "msg": "Stmt.Close Complete", stmtIDKey: stmtIDExpected, connIDKey: connIDExpected}, }) }() logs.Assert(t, []map[string]interface{}{ {"level": "VERBOSE", "msg": "Conn.ResetSession Start", connIDKey: connIDExpected}, {"level": "TRACE", "msg": "Conn.ResetSession Complete", connIDKey: connIDExpected}, - {"level": "TRACE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, - {"level": "INFO", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, + {"level": "VERBOSE", "msg": "Conn.PrepareContext Start", "query": query, connIDKey: connIDExpected}, + {"level": "TRACE", "msg": "Conn.PrepareContext Complete", "query": query, connIDKey: connIDExpected, stmtIDKey: stmtIDExpected}, }) t.Run("Stmt.ExecContext", func(t *testing.T) { From aad8eb527a9d0fa1c28bc34b086f37b5418197aa Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 23:26:43 +0900 Subject: [PATCH 08/11] =?UTF-8?q?=F0=9F=93=9D=20Update=20log=20examples=20?= =?UTF-8?q?in=20examples/logs-*/results?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $ make -C example --- examples/logs-mysql/results/debug-log.txt | 69 ++++--- examples/logs-mysql/results/info-log.txt | 71 ++++--- examples/logs-mysql/results/trace-log.txt | 153 +++++++-------- examples/logs-mysql/results/verbose-log.json | 174 ++++++++---------- examples/logs-mysql/results/verbose-log.txt | 174 ++++++++---------- examples/logs-postgres/results/debug-log.txt | 30 +-- examples/logs-postgres/results/info-log.txt | 22 +-- examples/logs-postgres/results/trace-log.txt | 64 +++---- .../logs-postgres/results/verbose-log.json | 82 ++++----- .../logs-postgres/results/verbose-log.txt | 82 ++++----- examples/logs-sqlite3/results/debug-log.txt | 26 +-- examples/logs-sqlite3/results/info-log.txt | 18 +- examples/logs-sqlite3/results/trace-log.txt | 48 ++--- .../logs-sqlite3/results/verbose-log.json | 58 +++--- examples/logs-sqlite3/results/verbose-log.txt | 58 +++--- 15 files changed, 543 insertions(+), 586 deletions(-) diff --git a/examples/logs-mysql/results/debug-log.txt b/examples/logs-mysql/results/debug-log.txt index 14576d2..556d38a 100644 --- a/examples/logs-mysql/results/debug-log.txt +++ b/examples/logs-mysql/results/debug-log.txt @@ -1,35 +1,34 @@ -time=2025-08-06T22:40:48.812+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=2333 conn_id=qhQzjf98qOFNJdgL -time=2025-08-06T22:40:48.812+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=172542 -time=2025-08-06T22:40:48.813+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=1652416 error="driver: bad connection" -time=2025-08-06T22:40:48.813+09:00 level=ERROR msg=Connector.Connect duration=1675375 error="driver: bad connection" -time=2025-08-06T22:40:48.814+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=467125 error="driver: bad connection" -time=2025-08-06T22:40:48.814+09:00 level=ERROR msg=Connector.Connect duration=476000 error="driver: bad connection" -time=2025-08-06T22:40:48.814+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=361667 error="driver: bad connection" -time=2025-08-06T22:40:48.814+09:00 level=ERROR msg=Connector.Connect duration=375208 error="driver: bad connection" -time=2025-08-06T22:40:50.819+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=2992875 error="driver: bad connection" -time=2025-08-06T22:40:50.819+09:00 level=ERROR msg=Connector.Connect duration=3249625 error="driver: bad connection" -time=2025-08-06T22:40:50.821+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=1743208 error="driver: bad connection" -time=2025-08-06T22:40:50.821+09:00 level=ERROR msg=Connector.Connect duration=1812375 error="driver: bad connection" -time=2025-08-06T22:40:50.822+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=1459584 error="driver: bad connection" -time=2025-08-06T22:40:50.822+09:00 level=ERROR msg=Connector.Connect duration=1549541 error="driver: bad connection" -time=2025-08-06T22:40:52.825+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=1326000 error="driver: bad connection" -time=2025-08-06T22:40:52.825+09:00 level=ERROR msg=Connector.Connect duration=1407584 error="driver: bad connection" -time=2025-08-06T22:40:52.826+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=719750 error="driver: bad connection" -time=2025-08-06T22:40:52.826+09:00 level=ERROR msg=Connector.Connect duration=817417 error="driver: bad connection" -time=2025-08-06T22:40:52.827+09:00 level=ERROR msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=1094750 error="driver: bad connection" -time=2025-08-06T22:40:52.827+09:00 level=ERROR msg=Connector.Connect duration=1135167 error="driver: bad connection" -time=2025-08-06T22:40:54.833+09:00 level=INFO msg=Connector.Connect conn_id=qhQzjf98qOFNJdgL duration=4789125 -time=2025-08-06T22:40:54.833+09:00 level=INFO msg=Connector.Connect duration=4890833 -time=2025-08-06T22:40:54.849+09:00 level=INFO msg=Conn.ExecContext conn_id=qhQzjf98qOFNJdgL query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=15801167 -time=2025-08-06T22:40:54.850+09:00 level=INFO msg=Conn.BeginTx conn_id=qhQzjf98qOFNJdgL duration=204125 tx_id=rLlvDtd8PJM9Mj1V -time=2025-08-06T22:40:54.850+09:00 level=INFO msg=Conn.ExecContext conn_id=qhQzjf98qOFNJdgL query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=625 skip=true -time=2025-08-06T22:40:54.852+09:00 level=INFO msg=Conn.PrepareContext conn_id=qhQzjf98qOFNJdgL query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=2058208 stmt_id=i4jPyOnla62ANYON -time=2025-08-06T22:40:54.852+09:00 level=INFO msg=Stmt.ExecContext conn_id=qhQzjf98qOFNJdgL stmt_id=i4jPyOnla62ANYON args="[1,\"Alice\"]" duration=233541 -time=2025-08-06T22:40:54.853+09:00 level=INFO msg=Stmt.Close conn_id=qhQzjf98qOFNJdgL stmt_id=i4jPyOnla62ANYON duration=10625 -time=2025-08-06T22:40:54.855+09:00 level=INFO msg=Tx.Commit conn_id=qhQzjf98qOFNJdgL tx_id=rLlvDtd8PJM9Mj1V duration=2395375 -time=2025-08-06T22:40:54.855+09:00 level=DEBUG msg=Conn.QueryContext conn_id=qhQzjf98qOFNJdgL query="SELECT * FROM test1" args=[] duration=252625 -time=2025-08-06T22:40:54.855+09:00 level=DEBUG msg=Rows.Next conn_id=qhQzjf98qOFNJdgL duration=2750 eof=false -time=2025-08-06T22:40:54.855+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:40:54.855+09:00 level=DEBUG msg=Rows.Next conn_id=qhQzjf98qOFNJdgL duration=166 eof=true -time=2025-08-06T22:40:54.855+09:00 level=DEBUG msg=Rows.Close conn_id=qhQzjf98qOFNJdgL duration=416 -time=2025-08-06T22:40:54.856+09:00 level=INFO msg=Conn.Close conn_id=qhQzjf98qOFNJdgL duration=44834 +time=2025-08-06T23:24:18.087+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=10917 conn_id=OeV2RQ9XRdMCt45H +time=2025-08-06T23:24:18.087+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=470875 +time=2025-08-06T23:24:18.089+09:00 level=ERROR msg=Connector.Connect conn_id=OeV2RQ9XRdMCt45H duration=2305125 error="driver: bad connection" +time=2025-08-06T23:24:18.089+09:00 level=ERROR msg=Connector.Connect duration=2338958 error="driver: bad connection" +time=2025-08-06T23:24:18.090+09:00 level=ERROR msg=Connector.Connect conn_id=OeV2RQ9XRdMCt45H duration=714542 error="driver: bad connection" +time=2025-08-06T23:24:18.090+09:00 level=ERROR msg=Connector.Connect duration=770750 error="driver: bad connection" +time=2025-08-06T23:24:18.091+09:00 level=ERROR msg=Connector.Connect conn_id=OeV2RQ9XRdMCt45H duration=683833 error="driver: bad connection" +time=2025-08-06T23:24:18.091+09:00 level=ERROR msg=Connector.Connect duration=693000 error="driver: bad connection" +time=2025-08-06T23:24:20.093+09:00 level=ERROR msg=Connector.Connect conn_id=OeV2RQ9XRdMCt45H duration=1196917 error="driver: bad connection" +time=2025-08-06T23:24:20.093+09:00 level=ERROR msg=Connector.Connect duration=1244834 error="driver: bad connection" +time=2025-08-06T23:24:20.094+09:00 level=ERROR msg=Connector.Connect conn_id=OeV2RQ9XRdMCt45H duration=1030584 error="driver: bad connection" +time=2025-08-06T23:24:20.094+09:00 level=ERROR msg=Connector.Connect duration=1042042 error="driver: bad connection" +time=2025-08-06T23:24:20.096+09:00 level=ERROR msg=Connector.Connect conn_id=OeV2RQ9XRdMCt45H duration=1188083 error="driver: bad connection" +time=2025-08-06T23:24:20.096+09:00 level=ERROR msg=Connector.Connect duration=1195750 error="driver: bad connection" +time=2025-08-06T23:24:22.097+09:00 level=ERROR msg=Connector.Connect conn_id=OeV2RQ9XRdMCt45H duration=843625 error="driver: bad connection" +time=2025-08-06T23:24:22.097+09:00 level=ERROR msg=Connector.Connect duration=874750 error="driver: bad connection" +time=2025-08-06T23:24:22.097+09:00 level=ERROR msg=Connector.Connect conn_id=OeV2RQ9XRdMCt45H duration=464875 error="driver: bad connection" +time=2025-08-06T23:24:22.097+09:00 level=ERROR msg=Connector.Connect duration=475041 error="driver: bad connection" +time=2025-08-06T23:24:22.097+09:00 level=ERROR msg=Connector.Connect conn_id=OeV2RQ9XRdMCt45H duration=337459 error="driver: bad connection" +time=2025-08-06T23:24:22.097+09:00 level=ERROR msg=Connector.Connect duration=346666 error="driver: bad connection" +time=2025-08-06T23:24:24.103+09:00 level=INFO msg=Connector.Connect conn_id=OeV2RQ9XRdMCt45H duration=4660583 +time=2025-08-06T23:24:24.103+09:00 level=INFO msg=Connector.Connect duration=4740458 +time=2025-08-06T23:24:24.122+09:00 level=INFO msg=Conn.ExecContext conn_id=OeV2RQ9XRdMCt45H query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=17941958 +time=2025-08-06T23:24:24.122+09:00 level=INFO msg=Conn.BeginTx conn_id=OeV2RQ9XRdMCt45H duration=244000 tx_id=2Z_gwjGK0ZsOhmKL +time=2025-08-06T23:24:24.122+09:00 level=INFO msg=Conn.ExecContext conn_id=OeV2RQ9XRdMCt45H query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=541 skip=true +time=2025-08-06T23:24:24.127+09:00 level=DEBUG msg=Stmt.ExecContext conn_id=OeV2RQ9XRdMCt45H stmt_id=Sh0A2dDAax1M8Fuj args="[1,\"Alice\"]" duration=610916 +time=2025-08-06T23:24:24.127+09:00 level=DEBUG msg=Stmt.Close conn_id=OeV2RQ9XRdMCt45H stmt_id=Sh0A2dDAax1M8Fuj duration=7917 +time=2025-08-06T23:24:24.128+09:00 level=INFO msg=Tx.Commit conn_id=OeV2RQ9XRdMCt45H tx_id=2Z_gwjGK0ZsOhmKL duration=1560625 +time=2025-08-06T23:24:24.129+09:00 level=DEBUG msg=Conn.QueryContext conn_id=OeV2RQ9XRdMCt45H query="SELECT * FROM test1" args=[] duration=299875 +time=2025-08-06T23:24:24.129+09:00 level=DEBUG msg=Rows.Next conn_id=OeV2RQ9XRdMCt45H duration=1458 eof=false +time=2025-08-06T23:24:24.129+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:24:24.129+09:00 level=DEBUG msg=Rows.Next conn_id=OeV2RQ9XRdMCt45H duration=42 eof=true +time=2025-08-06T23:24:24.129+09:00 level=DEBUG msg=Rows.Close conn_id=OeV2RQ9XRdMCt45H duration=167 +time=2025-08-06T23:24:24.129+09:00 level=INFO msg=Conn.Close conn_id=OeV2RQ9XRdMCt45H duration=20500 diff --git a/examples/logs-mysql/results/info-log.txt b/examples/logs-mysql/results/info-log.txt index 3fefa02..5f04202 100644 --- a/examples/logs-mysql/results/info-log.txt +++ b/examples/logs-mysql/results/info-log.txt @@ -1,37 +1,34 @@ -time=2025-08-06T22:40:38.842+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=11334 conn_id=A6FXYv78lOwZ8y9n -time=2025-08-06T22:40:38.842+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=1543167 -time=2025-08-06T22:40:38.844+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=2394084 error="driver: bad connection" -time=2025-08-06T22:40:38.844+09:00 level=ERROR msg=Connector.Connect duration=2410333 error="driver: bad connection" -time=2025-08-06T22:40:38.845+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=506417 error="driver: bad connection" -time=2025-08-06T22:40:38.845+09:00 level=ERROR msg=Connector.Connect duration=519667 error="driver: bad connection" -time=2025-08-06T22:40:38.845+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=362417 error="driver: bad connection" -time=2025-08-06T22:40:38.845+09:00 level=ERROR msg=Connector.Connect duration=371083 error="driver: bad connection" -time=2025-08-06T22:40:40.849+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=2862208 error="driver: bad connection" -time=2025-08-06T22:40:40.849+09:00 level=ERROR msg=Connector.Connect duration=3024167 error="driver: bad connection" -time=2025-08-06T22:40:40.852+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=2618458 error="driver: bad connection" -time=2025-08-06T22:40:40.852+09:00 level=ERROR msg=Connector.Connect duration=2717125 error="driver: bad connection" -time=2025-08-06T22:40:40.854+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=1869042 error="driver: bad connection" -time=2025-08-06T22:40:40.854+09:00 level=ERROR msg=Connector.Connect duration=2062375 error="driver: bad connection" -time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=1294625 error="driver: bad connection" -time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect duration=1344917 error="driver: bad connection" -time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=461791 error="driver: bad connection" -time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect duration=485417 error="driver: bad connection" -time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=369500 error="driver: bad connection" -time=2025-08-06T22:40:42.857+09:00 level=ERROR msg=Connector.Connect duration=390000 error="driver: bad connection" -time=2025-08-06T22:40:44.861+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=2671958 error="driver: bad connection" -time=2025-08-06T22:40:44.861+09:00 level=ERROR msg=Connector.Connect duration=2859000 error="driver: bad connection" -time=2025-08-06T22:40:44.863+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=1390583 error="driver: bad connection" -time=2025-08-06T22:40:44.863+09:00 level=ERROR msg=Connector.Connect duration=1446709 error="driver: bad connection" -time=2025-08-06T22:40:44.865+09:00 level=ERROR msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=1884375 error="driver: bad connection" -time=2025-08-06T22:40:44.865+09:00 level=ERROR msg=Connector.Connect duration=1914500 error="driver: bad connection" -time=2025-08-06T22:40:46.869+09:00 level=INFO msg=Connector.Connect conn_id=A6FXYv78lOwZ8y9n duration=3110583 -time=2025-08-06T22:40:46.870+09:00 level=INFO msg=Connector.Connect duration=3959167 -time=2025-08-06T22:40:46.886+09:00 level=INFO msg=Conn.ExecContext conn_id=A6FXYv78lOwZ8y9n query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=15618125 -time=2025-08-06T22:40:46.887+09:00 level=INFO msg=Conn.BeginTx conn_id=A6FXYv78lOwZ8y9n duration=258333 tx_id=MIZHAmY0QXNBxX4l -time=2025-08-06T22:40:46.887+09:00 level=INFO msg=Conn.ExecContext conn_id=A6FXYv78lOwZ8y9n query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=667 skip=true -time=2025-08-06T22:40:46.892+09:00 level=INFO msg=Conn.PrepareContext conn_id=A6FXYv78lOwZ8y9n query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=4744791 stmt_id=3annGcQ7kutRe7kw -time=2025-08-06T22:40:46.893+09:00 level=INFO msg=Stmt.ExecContext conn_id=A6FXYv78lOwZ8y9n stmt_id=3annGcQ7kutRe7kw args="[1,\"Alice\"]" duration=503333 -time=2025-08-06T22:40:46.893+09:00 level=INFO msg=Stmt.Close conn_id=A6FXYv78lOwZ8y9n stmt_id=3annGcQ7kutRe7kw duration=8875 -time=2025-08-06T22:40:46.894+09:00 level=INFO msg=Tx.Commit conn_id=A6FXYv78lOwZ8y9n tx_id=MIZHAmY0QXNBxX4l duration=1582416 -time=2025-08-06T22:40:46.895+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:40:46.895+09:00 level=INFO msg=Conn.Close conn_id=A6FXYv78lOwZ8y9n duration=27375 +time=2025-08-06T23:24:08.002+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=20000 conn_id=DfU15vIYYze23D37 +time=2025-08-06T23:24:08.002+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=1456250 +time=2025-08-06T23:24:08.005+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=3119500 error="driver: bad connection" +time=2025-08-06T23:24:08.005+09:00 level=ERROR msg=Connector.Connect duration=3177541 error="driver: bad connection" +time=2025-08-06T23:24:08.006+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=700125 error="driver: bad connection" +time=2025-08-06T23:24:08.006+09:00 level=ERROR msg=Connector.Connect duration=746833 error="driver: bad connection" +time=2025-08-06T23:24:08.006+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=515250 error="driver: bad connection" +time=2025-08-06T23:24:08.006+09:00 level=ERROR msg=Connector.Connect duration=556833 error="driver: bad connection" +time=2025-08-06T23:24:10.009+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=1850209 error="driver: bad connection" +time=2025-08-06T23:24:10.009+09:00 level=ERROR msg=Connector.Connect duration=1957167 error="driver: bad connection" +time=2025-08-06T23:24:10.010+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=1011375 error="driver: bad connection" +time=2025-08-06T23:24:10.010+09:00 level=ERROR msg=Connector.Connect duration=1046458 error="driver: bad connection" +time=2025-08-06T23:24:10.011+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=605875 error="driver: bad connection" +time=2025-08-06T23:24:10.011+09:00 level=ERROR msg=Connector.Connect duration=615958 error="driver: bad connection" +time=2025-08-06T23:24:12.013+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=1167709 error="driver: bad connection" +time=2025-08-06T23:24:12.013+09:00 level=ERROR msg=Connector.Connect duration=1237792 error="driver: bad connection" +time=2025-08-06T23:24:12.014+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=778959 error="driver: bad connection" +time=2025-08-06T23:24:12.014+09:00 level=ERROR msg=Connector.Connect duration=828834 error="driver: bad connection" +time=2025-08-06T23:24:12.014+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=622583 error="driver: bad connection" +time=2025-08-06T23:24:12.014+09:00 level=ERROR msg=Connector.Connect duration=686917 error="driver: bad connection" +time=2025-08-06T23:24:14.020+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=4834000 error="driver: bad connection" +time=2025-08-06T23:24:14.021+09:00 level=ERROR msg=Connector.Connect duration=5222417 error="driver: bad connection" +time=2025-08-06T23:24:14.023+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=1818292 error="driver: bad connection" +time=2025-08-06T23:24:14.023+09:00 level=ERROR msg=Connector.Connect duration=1909917 error="driver: bad connection" +time=2025-08-06T23:24:14.024+09:00 level=ERROR msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=1358083 error="driver: bad connection" +time=2025-08-06T23:24:14.024+09:00 level=ERROR msg=Connector.Connect duration=1482167 error="driver: bad connection" +time=2025-08-06T23:24:16.028+09:00 level=INFO msg=Connector.Connect conn_id=DfU15vIYYze23D37 duration=2883875 +time=2025-08-06T23:24:16.028+09:00 level=INFO msg=Connector.Connect duration=2958417 +time=2025-08-06T23:24:16.043+09:00 level=INFO msg=Conn.ExecContext conn_id=DfU15vIYYze23D37 query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=14629041 +time=2025-08-06T23:24:16.043+09:00 level=INFO msg=Conn.BeginTx conn_id=DfU15vIYYze23D37 duration=367084 tx_id=NxCr1kqGEs0dOBQz +time=2025-08-06T23:24:16.043+09:00 level=INFO msg=Conn.ExecContext conn_id=DfU15vIYYze23D37 query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=500 skip=true +time=2025-08-06T23:24:16.049+09:00 level=INFO msg=Tx.Commit conn_id=DfU15vIYYze23D37 tx_id=NxCr1kqGEs0dOBQz duration=1386458 +time=2025-08-06T23:24:16.049+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:24:16.049+09:00 level=INFO msg=Conn.Close conn_id=DfU15vIYYze23D37 duration=27667 diff --git a/examples/logs-mysql/results/trace-log.txt b/examples/logs-mysql/results/trace-log.txt index a17d112..cc6af01 100644 --- a/examples/logs-mysql/results/trace-log.txt +++ b/examples/logs-mysql/results/trace-log.txt @@ -1,84 +1,69 @@ -time=2025-08-06T22:40:56.743+09:00 level=TRACE msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 -time=2025-08-06T22:40:56.744+09:00 level=TRACE msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 -time=2025-08-06T22:40:56.744+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=1458 conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:40:56.744+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=43750 -time=2025-08-06T22:40:56.744+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:56.744+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:40:56.746+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=2237042 error="driver: bad connection" -time=2025-08-06T22:40:56.746+09:00 level=ERROR msg=Connector.Connect duration=2288333 error="driver: bad connection" -time=2025-08-06T22:40:56.746+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:56.746+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:40:56.747+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=623708 error="driver: bad connection" -time=2025-08-06T22:40:56.747+09:00 level=ERROR msg=Connector.Connect duration=662500 error="driver: bad connection" -time=2025-08-06T22:40:56.747+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:56.747+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:40:56.747+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=503209 error="driver: bad connection" -time=2025-08-06T22:40:56.747+09:00 level=ERROR msg=Connector.Connect duration=552792 error="driver: bad connection" -time=2025-08-06T22:40:58.748+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:58.749+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:40:58.751+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=2517917 error="driver: bad connection" -time=2025-08-06T22:40:58.751+09:00 level=ERROR msg=Connector.Connect duration=2650833 error="driver: bad connection" -time=2025-08-06T22:40:58.751+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:58.751+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:40:58.753+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1943292 error="driver: bad connection" -time=2025-08-06T22:40:58.753+09:00 level=ERROR msg=Connector.Connect duration=2021625 error="driver: bad connection" -time=2025-08-06T22:40:58.753+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:58.753+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:40:58.755+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1519792 error="driver: bad connection" -time=2025-08-06T22:40:58.755+09:00 level=ERROR msg=Connector.Connect duration=1599500 error="driver: bad connection" -time=2025-08-06T22:41:00.756+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:00.756+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:41:00.757+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1327833 error="driver: bad connection" -time=2025-08-06T22:41:00.757+09:00 level=ERROR msg=Connector.Connect duration=1426625 error="driver: bad connection" -time=2025-08-06T22:41:00.757+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:00.757+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:41:00.758+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=785333 error="driver: bad connection" -time=2025-08-06T22:41:00.758+09:00 level=ERROR msg=Connector.Connect duration=834084 error="driver: bad connection" -time=2025-08-06T22:41:00.758+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:00.758+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:41:00.758+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=388834 error="driver: bad connection" -time=2025-08-06T22:41:00.758+09:00 level=ERROR msg=Connector.Connect duration=428166 error="driver: bad connection" -time=2025-08-06T22:41:02.760+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:02.760+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:41:02.762+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1888375 error="driver: bad connection" -time=2025-08-06T22:41:02.762+09:00 level=ERROR msg=Connector.Connect duration=2027250 error="driver: bad connection" -time=2025-08-06T22:41:02.762+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:02.762+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:41:02.763+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1337959 error="driver: bad connection" -time=2025-08-06T22:41:02.764+09:00 level=ERROR msg=Connector.Connect duration=1406750 error="driver: bad connection" -time=2025-08-06T22:41:02.764+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:02.764+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:41:02.765+09:00 level=ERROR msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=1216542 error="driver: bad connection" -time=2025-08-06T22:41:02.765+09:00 level=ERROR msg=Connector.Connect duration=1287500 error="driver: bad connection" -time=2025-08-06T22:41:04.766+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:04.766+09:00 level=TRACE msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:41:04.769+09:00 level=INFO msg=Connector.Connect conn_id=ZmYjSEmgE8rqULQF duration=3320875 -time=2025-08-06T22:41:04.769+09:00 level=INFO msg=Connector.Connect duration=3370250 -time=2025-08-06T22:41:04.770+09:00 level=TRACE msg=Conn.Ping conn_id=ZmYjSEmgE8rqULQF duration=591917 -time=2025-08-06T22:41:04.770+09:00 level=TRACE msg=Conn.ResetSession conn_id=ZmYjSEmgE8rqULQF duration=2750 -time=2025-08-06T22:41:04.770+09:00 level=TRACE msg=Conn.ExecContext conn_id=ZmYjSEmgE8rqULQF query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-08-06T22:41:04.787+09:00 level=INFO msg=Conn.ExecContext conn_id=ZmYjSEmgE8rqULQF query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=17286625 -time=2025-08-06T22:41:04.787+09:00 level=TRACE msg=Conn.ResetSession conn_id=ZmYjSEmgE8rqULQF duration=4334 -time=2025-08-06T22:41:04.788+09:00 level=TRACE msg=Conn.Ping conn_id=ZmYjSEmgE8rqULQF duration=375542 -time=2025-08-06T22:41:04.788+09:00 level=TRACE msg=Conn.ResetSession conn_id=ZmYjSEmgE8rqULQF duration=1708 -time=2025-08-06T22:41:04.788+09:00 level=TRACE msg=Conn.BeginTx conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:41:04.788+09:00 level=INFO msg=Conn.BeginTx conn_id=ZmYjSEmgE8rqULQF duration=318708 tx_id=DYa4f8mCkdxdJyp1 -time=2025-08-06T22:41:04.788+09:00 level=TRACE msg=Conn.ExecContext conn_id=ZmYjSEmgE8rqULQF query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" -time=2025-08-06T22:41:04.788+09:00 level=INFO msg=Conn.ExecContext conn_id=ZmYjSEmgE8rqULQF query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=583 skip=true -time=2025-08-06T22:41:04.788+09:00 level=TRACE msg=Conn.PrepareContext conn_id=ZmYjSEmgE8rqULQF query="INSERT INTO test1 (id, name) VALUES (?, ?)" -time=2025-08-06T22:41:04.792+09:00 level=INFO msg=Conn.PrepareContext conn_id=ZmYjSEmgE8rqULQF query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=3755541 stmt_id=dTT5Qw_jeH05OiNu -time=2025-08-06T22:41:04.792+09:00 level=TRACE msg=Stmt.ExecContext conn_id=ZmYjSEmgE8rqULQF stmt_id=dTT5Qw_jeH05OiNu args="[1,\"Alice\"]" -time=2025-08-06T22:41:04.793+09:00 level=INFO msg=Stmt.ExecContext conn_id=ZmYjSEmgE8rqULQF stmt_id=dTT5Qw_jeH05OiNu args="[1,\"Alice\"]" duration=397708 -time=2025-08-06T22:41:04.793+09:00 level=TRACE msg=Stmt.Close conn_id=ZmYjSEmgE8rqULQF stmt_id=dTT5Qw_jeH05OiNu -time=2025-08-06T22:41:04.793+09:00 level=INFO msg=Stmt.Close conn_id=ZmYjSEmgE8rqULQF stmt_id=dTT5Qw_jeH05OiNu duration=14416 -time=2025-08-06T22:41:04.793+09:00 level=TRACE msg=Tx.Commit conn_id=ZmYjSEmgE8rqULQF tx_id=DYa4f8mCkdxdJyp1 -time=2025-08-06T22:41:04.794+09:00 level=INFO msg=Tx.Commit conn_id=ZmYjSEmgE8rqULQF tx_id=DYa4f8mCkdxdJyp1 duration=1512042 -time=2025-08-06T22:41:04.794+09:00 level=TRACE msg=Conn.ResetSession conn_id=ZmYjSEmgE8rqULQF duration=3875 -time=2025-08-06T22:41:04.794+09:00 level=TRACE msg=Conn.QueryContext conn_id=ZmYjSEmgE8rqULQF query="SELECT * FROM test1" args=[] -time=2025-08-06T22:41:04.795+09:00 level=DEBUG msg=Conn.QueryContext conn_id=ZmYjSEmgE8rqULQF query="SELECT * FROM test1" args=[] duration=348334 -time=2025-08-06T22:41:04.795+09:00 level=DEBUG msg=Rows.Next conn_id=ZmYjSEmgE8rqULQF duration=2041 eof=false -time=2025-08-06T22:41:04.795+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:41:04.795+09:00 level=DEBUG msg=Rows.Next conn_id=ZmYjSEmgE8rqULQF duration=125 eof=true -time=2025-08-06T22:41:04.795+09:00 level=DEBUG msg=Rows.Close conn_id=ZmYjSEmgE8rqULQF duration=417 -time=2025-08-06T22:41:04.795+09:00 level=TRACE msg=Conn.Close conn_id=ZmYjSEmgE8rqULQF -time=2025-08-06T22:41:04.795+09:00 level=INFO msg=Conn.Close conn_id=ZmYjSEmgE8rqULQF duration=31208 +time=2025-08-06T23:24:26.072+09:00 level=TRACE msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 +time=2025-08-06T23:24:26.073+09:00 level=TRACE msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 +time=2025-08-06T23:24:26.073+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=1791 conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:26.073+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=44208 +time=2025-08-06T23:24:26.073+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:26.073+09:00 level=TRACE msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:26.075+09:00 level=ERROR msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB duration=2257875 error="driver: bad connection" +time=2025-08-06T23:24:26.075+09:00 level=ERROR msg=Connector.Connect duration=2296083 error="driver: bad connection" +time=2025-08-06T23:24:26.075+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:26.075+09:00 level=TRACE msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:26.076+09:00 level=ERROR msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB duration=1240208 error="driver: bad connection" +time=2025-08-06T23:24:26.076+09:00 level=ERROR msg=Connector.Connect duration=1263291 error="driver: bad connection" +time=2025-08-06T23:24:26.076+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:26.076+09:00 level=TRACE msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:26.077+09:00 level=ERROR msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB duration=667000 error="driver: bad connection" +time=2025-08-06T23:24:26.077+09:00 level=ERROR msg=Connector.Connect duration=677000 error="driver: bad connection" +time=2025-08-06T23:24:28.078+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:28.078+09:00 level=TRACE msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:28.080+09:00 level=ERROR msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB duration=1639000 error="driver: bad connection" +time=2025-08-06T23:24:28.080+09:00 level=ERROR msg=Connector.Connect duration=1679500 error="driver: bad connection" +time=2025-08-06T23:24:28.080+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:28.080+09:00 level=TRACE msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:28.081+09:00 level=ERROR msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB duration=896542 error="driver: bad connection" +time=2025-08-06T23:24:28.081+09:00 level=ERROR msg=Connector.Connect duration=919709 error="driver: bad connection" +time=2025-08-06T23:24:28.081+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:28.081+09:00 level=TRACE msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:28.081+09:00 level=ERROR msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB duration=728625 error="driver: bad connection" +time=2025-08-06T23:24:28.081+09:00 level=ERROR msg=Connector.Connect duration=741417 error="driver: bad connection" +time=2025-08-06T23:24:30.082+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:30.083+09:00 level=TRACE msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:30.084+09:00 level=ERROR msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB duration=1314417 error="driver: bad connection" +time=2025-08-06T23:24:30.084+09:00 level=ERROR msg=Connector.Connect duration=1389833 error="driver: bad connection" +time=2025-08-06T23:24:30.084+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:30.084+09:00 level=TRACE msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:30.084+09:00 level=ERROR msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB duration=442416 error="driver: bad connection" +time=2025-08-06T23:24:30.084+09:00 level=ERROR msg=Connector.Connect duration=467583 error="driver: bad connection" +time=2025-08-06T23:24:30.084+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:30.084+09:00 level=TRACE msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:30.085+09:00 level=ERROR msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB duration=406833 error="driver: bad connection" +time=2025-08-06T23:24:30.085+09:00 level=ERROR msg=Connector.Connect duration=452583 error="driver: bad connection" +time=2025-08-06T23:24:32.086+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:32.086+09:00 level=TRACE msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:32.090+09:00 level=INFO msg=Connector.Connect conn_id=reWaqdYvKTj5sOEB duration=3710084 +time=2025-08-06T23:24:32.090+09:00 level=INFO msg=Connector.Connect duration=3784875 +time=2025-08-06T23:24:32.090+09:00 level=TRACE msg=Conn.Ping conn_id=reWaqdYvKTj5sOEB duration=393583 +time=2025-08-06T23:24:32.090+09:00 level=TRACE msg=Conn.ResetSession conn_id=reWaqdYvKTj5sOEB duration=2750 +time=2025-08-06T23:24:32.090+09:00 level=TRACE msg=Conn.ExecContext conn_id=reWaqdYvKTj5sOEB query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T23:24:32.106+09:00 level=INFO msg=Conn.ExecContext conn_id=reWaqdYvKTj5sOEB query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=15972375 +time=2025-08-06T23:24:32.106+09:00 level=TRACE msg=Conn.ResetSession conn_id=reWaqdYvKTj5sOEB duration=5041 +time=2025-08-06T23:24:32.107+09:00 level=TRACE msg=Conn.Ping conn_id=reWaqdYvKTj5sOEB duration=343125 +time=2025-08-06T23:24:32.107+09:00 level=TRACE msg=Conn.ResetSession conn_id=reWaqdYvKTj5sOEB duration=2125 +time=2025-08-06T23:24:32.107+09:00 level=TRACE msg=Conn.BeginTx conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:32.107+09:00 level=INFO msg=Conn.BeginTx conn_id=reWaqdYvKTj5sOEB duration=272958 tx_id=YhAZhiHVE3IPShAc +time=2025-08-06T23:24:32.107+09:00 level=TRACE msg=Conn.ExecContext conn_id=reWaqdYvKTj5sOEB query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" +time=2025-08-06T23:24:32.107+09:00 level=INFO msg=Conn.ExecContext conn_id=reWaqdYvKTj5sOEB query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=1916 skip=true +time=2025-08-06T23:24:32.109+09:00 level=TRACE msg=Conn.PrepareContext conn_id=reWaqdYvKTj5sOEB query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=2169834 stmt_id=pdtww8qTfHJSRI1_ +time=2025-08-06T23:24:32.110+09:00 level=DEBUG msg=Stmt.ExecContext conn_id=reWaqdYvKTj5sOEB stmt_id=pdtww8qTfHJSRI1_ args="[1,\"Alice\"]" duration=279166 +time=2025-08-06T23:24:32.110+09:00 level=DEBUG msg=Stmt.Close conn_id=reWaqdYvKTj5sOEB stmt_id=pdtww8qTfHJSRI1_ duration=5291 +time=2025-08-06T23:24:32.110+09:00 level=TRACE msg=Tx.Commit conn_id=reWaqdYvKTj5sOEB tx_id=YhAZhiHVE3IPShAc +time=2025-08-06T23:24:32.111+09:00 level=INFO msg=Tx.Commit conn_id=reWaqdYvKTj5sOEB tx_id=YhAZhiHVE3IPShAc duration=1198792 +time=2025-08-06T23:24:32.111+09:00 level=TRACE msg=Conn.ResetSession conn_id=reWaqdYvKTj5sOEB duration=1708 +time=2025-08-06T23:24:32.111+09:00 level=TRACE msg=Conn.QueryContext conn_id=reWaqdYvKTj5sOEB query="SELECT * FROM test1" args=[] +time=2025-08-06T23:24:32.111+09:00 level=DEBUG msg=Conn.QueryContext conn_id=reWaqdYvKTj5sOEB query="SELECT * FROM test1" args=[] duration=278250 +time=2025-08-06T23:24:32.111+09:00 level=DEBUG msg=Rows.Next conn_id=reWaqdYvKTj5sOEB duration=1583 eof=false +time=2025-08-06T23:24:32.111+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:24:32.111+09:00 level=DEBUG msg=Rows.Next conn_id=reWaqdYvKTj5sOEB duration=83 eof=true +time=2025-08-06T23:24:32.111+09:00 level=DEBUG msg=Rows.Close conn_id=reWaqdYvKTj5sOEB duration=42 +time=2025-08-06T23:24:32.111+09:00 level=TRACE msg=Conn.Close conn_id=reWaqdYvKTj5sOEB +time=2025-08-06T23:24:32.111+09:00 level=INFO msg=Conn.Close conn_id=reWaqdYvKTj5sOEB duration=19000 diff --git a/examples/logs-mysql/results/verbose-log.json b/examples/logs-mysql/results/verbose-log.json index 8e3cf21..4c62cd3 100644 --- a/examples/logs-mysql/results/verbose-log.json +++ b/examples/logs-mysql/results/verbose-log.json @@ -1,93 +1,81 @@ -{"time":"2025-08-06T22:41:16.839039+09:00","level":"TRACE","msg":"Open","driver":"mysql","dsn":"root@tcp(localhost:3306)/app1"} -{"time":"2025-08-06T22:41:16.839214+09:00","level":"TRACE","msg":"Driver.OpenConnector","dsn":"root@tcp(localhost:3306)/app1"} -{"time":"2025-08-06T22:41:16.839221+09:00","level":"INFO","msg":"Driver.OpenConnector","dsn":"root@tcp(localhost:3306)/app1","duration":1584,"conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:16.839225+09:00","level":"INFO","msg":"Open","driver":"mysql","dsn":"root@tcp(localhost:3306)/app1","duration":41916} -{"time":"2025-08-06T22:41:16.839231+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:16.839234+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:16.841579+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":2339042,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:16.841593+09:00","level":"ERROR","msg":"Connector.Connect","duration":2358667,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:16.841599+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:16.841602+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:16.84241+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":794500,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:16.842443+09:00","level":"ERROR","msg":"Connector.Connect","duration":839541,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:16.842455+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:16.842461+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:16.843073+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":605000,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:16.843083+09:00","level":"ERROR","msg":"Connector.Connect","duration":621500,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:18.844242+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:18.84438+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:18.848667+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":4176791,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:18.848851+09:00","level":"ERROR","msg":"Connector.Connect","duration":4464750,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:18.848926+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:18.848962+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:18.851853+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":2856167,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:18.851949+09:00","level":"ERROR","msg":"Connector.Connect","duration":2983709,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:18.852+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:18.852035+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:18.85834+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":6260625,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:18.858435+09:00","level":"ERROR","msg":"Connector.Connect","duration":6396541,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:20.859537+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:20.859558+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:20.860372+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":805083,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:20.860382+09:00","level":"ERROR","msg":"Connector.Connect","duration":822709,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:20.860393+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:20.860396+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:20.860785+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":383250,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:20.860792+09:00","level":"ERROR","msg":"Connector.Connect","duration":395125,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:20.860796+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:20.860799+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:20.861176+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":372667,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:20.861185+09:00","level":"ERROR","msg":"Connector.Connect","duration":384459,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:22.862308+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:22.862505+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:22.86696+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":4369750,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:22.867109+09:00","level":"ERROR","msg":"Connector.Connect","duration":4595209,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:22.867173+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:22.867211+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:22.869814+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":2553458,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:22.869995+09:00","level":"ERROR","msg":"Connector.Connect","duration":2774250,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:22.870057+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:22.870092+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:22.874422+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":4293708,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:22.874533+09:00","level":"ERROR","msg":"Connector.Connect","duration":4436334,"error":"driver: bad connection"} -{"time":"2025-08-06T22:41:24.875716+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:41:24.875863+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.882783+09:00","level":"INFO","msg":"Connector.Connect","conn_id":"qt39X5RgR8WwzW8a","duration":6851459} -{"time":"2025-08-06T22:41:24.882904+09:00","level":"INFO","msg":"Connector.Connect","duration":7038458} -{"time":"2025-08-06T22:41:24.882953+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.883969+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"qt39X5RgR8WwzW8a","duration":975375} -{"time":"2025-08-06T22:41:24.88406+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.88411+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a","duration":10583} -{"time":"2025-08-06T22:41:24.884148+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"qt39X5RgR8WwzW8a","query":"CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))","args":"[]"} -{"time":"2025-08-06T22:41:24.906928+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"qt39X5RgR8WwzW8a","query":"CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":22720708} -{"time":"2025-08-06T22:41:24.906999+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.907031+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a","duration":7042} -{"time":"2025-08-06T22:41:24.907081+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.907484+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"qt39X5RgR8WwzW8a","duration":381375} -{"time":"2025-08-06T22:41:24.907521+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.907544+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a","duration":3958} -{"time":"2025-08-06T22:41:24.907564+09:00","level":"TRACE","msg":"Conn.BeginTx","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.907901+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"qt39X5RgR8WwzW8a","duration":318916,"tx_id":"NtCOAzYZWvhnrpwP"} -{"time":"2025-08-06T22:41:24.907963+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"qt39X5RgR8WwzW8a","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","args":"[1,\"Alice\"]"} -{"time":"2025-08-06T22:41:24.908004+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"qt39X5RgR8WwzW8a","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","args":"[1,\"Alice\"]","duration":1125,"skip":true} -{"time":"2025-08-06T22:41:24.908022+09:00","level":"TRACE","msg":"Conn.PrepareContext","conn_id":"qt39X5RgR8WwzW8a","query":"INSERT INTO test1 (id, name) VALUES (?, ?)"} -{"time":"2025-08-06T22:41:24.910059+09:00","level":"INFO","msg":"Conn.PrepareContext","conn_id":"qt39X5RgR8WwzW8a","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","duration":1987417,"stmt_id":"0dizLBDA5tePFJsI"} -{"time":"2025-08-06T22:41:24.910119+09:00","level":"TRACE","msg":"Stmt.ExecContext","conn_id":"qt39X5RgR8WwzW8a","stmt_id":"0dizLBDA5tePFJsI","args":"[1,\"Alice\"]"} -{"time":"2025-08-06T22:41:24.91054+09:00","level":"INFO","msg":"Stmt.ExecContext","conn_id":"qt39X5RgR8WwzW8a","stmt_id":"0dizLBDA5tePFJsI","args":"[1,\"Alice\"]","duration":394833} -{"time":"2025-08-06T22:41:24.910588+09:00","level":"TRACE","msg":"Stmt.Close","conn_id":"qt39X5RgR8WwzW8a","stmt_id":"0dizLBDA5tePFJsI"} -{"time":"2025-08-06T22:41:24.91064+09:00","level":"INFO","msg":"Stmt.Close","conn_id":"qt39X5RgR8WwzW8a","stmt_id":"0dizLBDA5tePFJsI","duration":25000} -{"time":"2025-08-06T22:41:24.910674+09:00","level":"TRACE","msg":"Tx.Commit","conn_id":"qt39X5RgR8WwzW8a","tx_id":"NtCOAzYZWvhnrpwP"} -{"time":"2025-08-06T22:41:24.912286+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"qt39X5RgR8WwzW8a","tx_id":"NtCOAzYZWvhnrpwP","duration":1573458} -{"time":"2025-08-06T22:41:24.912342+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.91236+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qt39X5RgR8WwzW8a","duration":3917} -{"time":"2025-08-06T22:41:24.912406+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"qt39X5RgR8WwzW8a","query":"SELECT * FROM test1","args":"[]"} -{"time":"2025-08-06T22:41:24.912819+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"qt39X5RgR8WwzW8a","query":"SELECT * FROM test1","args":"[]","duration":396583} -{"time":"2025-08-06T22:41:24.912844+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.912867+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"qt39X5RgR8WwzW8a","duration":3500,"eof":false} -{"time":"2025-08-06T22:41:24.912906+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} -{"time":"2025-08-06T22:41:24.912918+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.912932+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"qt39X5RgR8WwzW8a","duration":209,"eof":true} -{"time":"2025-08-06T22:41:24.912944+09:00","level":"VERBOSE","msg":"Rows.Close","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.912956+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"qt39X5RgR8WwzW8a","duration":541} -{"time":"2025-08-06T22:41:24.912977+09:00","level":"TRACE","msg":"Conn.Close","conn_id":"qt39X5RgR8WwzW8a"} -{"time":"2025-08-06T22:41:24.91305+09:00","level":"INFO","msg":"Conn.Close","conn_id":"qt39X5RgR8WwzW8a","duration":59625} +{"time":"2025-08-06T23:24:41.877871+09:00","level":"TRACE","msg":"Open","driver":"mysql","dsn":"root@tcp(localhost:3306)/app1"} +{"time":"2025-08-06T23:24:41.878054+09:00","level":"TRACE","msg":"Driver.OpenConnector","dsn":"root@tcp(localhost:3306)/app1"} +{"time":"2025-08-06T23:24:41.878062+09:00","level":"INFO","msg":"Driver.OpenConnector","dsn":"root@tcp(localhost:3306)/app1","duration":1625,"conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:41.878069+09:00","level":"INFO","msg":"Open","driver":"mysql","dsn":"root@tcp(localhost:3306)/app1","duration":51667} +{"time":"2025-08-06T23:24:41.878075+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:41.878078+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:41.88049+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE","duration":2403750,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:41.880506+09:00","level":"ERROR","msg":"Connector.Connect","duration":2427583,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:41.880511+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:41.880514+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:41.881278+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE","duration":758459,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:41.881302+09:00","level":"ERROR","msg":"Connector.Connect","duration":785333,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:41.881309+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:41.881312+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:41.881832+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE","duration":516208,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:41.881837+09:00","level":"ERROR","msg":"Connector.Connect","duration":524291,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:43.882888+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:43.882953+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:43.884604+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE","duration":1634041,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:43.884625+09:00","level":"ERROR","msg":"Connector.Connect","duration":1670791,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:43.884632+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:43.884636+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:43.885634+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE","duration":985250,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:43.88847+09:00","level":"ERROR","msg":"Connector.Connect","duration":3826875,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:43.888487+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:43.888491+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:43.890238+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE","duration":1740291,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:43.890255+09:00","level":"ERROR","msg":"Connector.Connect","duration":1763125,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:45.891645+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:45.891735+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:45.893756+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE","duration":1995291,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:45.893782+09:00","level":"ERROR","msg":"Connector.Connect","duration":2048167,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:45.893799+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:45.893803+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:45.894784+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE","duration":964333,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:45.894797+09:00","level":"ERROR","msg":"Connector.Connect","duration":994042,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:45.894801+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:45.894803+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:45.895773+09:00","level":"ERROR","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE","duration":957667,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:45.89581+09:00","level":"ERROR","msg":"Connector.Connect","duration":1004625,"error":"driver: bad connection"} +{"time":"2025-08-06T23:24:47.896942+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:47.897868+09:00","level":"TRACE","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.901816+09:00","level":"INFO","msg":"Connector.Connect","conn_id":"6ZZBD2D3aDGwhNkE","duration":3911083} +{"time":"2025-08-06T23:24:47.901851+09:00","level":"INFO","msg":"Connector.Connect","duration":3982666} +{"time":"2025-08-06T23:24:47.901865+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.902186+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"6ZZBD2D3aDGwhNkE","duration":309292} +{"time":"2025-08-06T23:24:47.902205+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.902218+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"6ZZBD2D3aDGwhNkE","duration":3667} +{"time":"2025-08-06T23:24:47.902228+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"6ZZBD2D3aDGwhNkE","query":"CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))","args":"[]"} +{"time":"2025-08-06T23:24:47.915704+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"6ZZBD2D3aDGwhNkE","query":"CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":13452750} +{"time":"2025-08-06T23:24:47.915743+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.915755+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"6ZZBD2D3aDGwhNkE","duration":3625} +{"time":"2025-08-06T23:24:47.915762+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.916125+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"6ZZBD2D3aDGwhNkE","duration":355458} +{"time":"2025-08-06T23:24:47.916137+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.916144+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"6ZZBD2D3aDGwhNkE","duration":1083} +{"time":"2025-08-06T23:24:47.916151+09:00","level":"TRACE","msg":"Conn.BeginTx","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.916831+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"6ZZBD2D3aDGwhNkE","duration":672666,"tx_id":"Bl9m5Xa70tXlAuwe"} +{"time":"2025-08-06T23:24:47.916863+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"6ZZBD2D3aDGwhNkE","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","args":"[1,\"Alice\"]"} +{"time":"2025-08-06T23:24:47.916879+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"6ZZBD2D3aDGwhNkE","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","args":"[1,\"Alice\"]","duration":459,"skip":true} +{"time":"2025-08-06T23:24:47.916886+09:00","level":"VERBOSE","msg":"Conn.PrepareContext","conn_id":"6ZZBD2D3aDGwhNkE","query":"INSERT INTO test1 (id, name) VALUES (?, ?)"} +{"time":"2025-08-06T23:24:47.919917+09:00","level":"TRACE","msg":"Conn.PrepareContext","conn_id":"6ZZBD2D3aDGwhNkE","query":"INSERT INTO test1 (id, name) VALUES (?, ?)","duration":3011083,"stmt_id":"_FmR8mX4J88SSrAb"} +{"time":"2025-08-06T23:24:47.919969+09:00","level":"VERBOSE","msg":"Stmt.ExecContext","conn_id":"6ZZBD2D3aDGwhNkE","stmt_id":"_FmR8mX4J88SSrAb","args":"[1,\"Alice\"]"} +{"time":"2025-08-06T23:24:47.920364+09:00","level":"DEBUG","msg":"Stmt.ExecContext","conn_id":"6ZZBD2D3aDGwhNkE","stmt_id":"_FmR8mX4J88SSrAb","args":"[1,\"Alice\"]","duration":389042} +{"time":"2025-08-06T23:24:47.920377+09:00","level":"VERBOSE","msg":"Stmt.Close","conn_id":"6ZZBD2D3aDGwhNkE","stmt_id":"_FmR8mX4J88SSrAb"} +{"time":"2025-08-06T23:24:47.920389+09:00","level":"DEBUG","msg":"Stmt.Close","conn_id":"6ZZBD2D3aDGwhNkE","stmt_id":"_FmR8mX4J88SSrAb","duration":6333} +{"time":"2025-08-06T23:24:47.9204+09:00","level":"TRACE","msg":"Tx.Commit","conn_id":"6ZZBD2D3aDGwhNkE","tx_id":"Bl9m5Xa70tXlAuwe"} +{"time":"2025-08-06T23:24:47.923121+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"6ZZBD2D3aDGwhNkE","tx_id":"Bl9m5Xa70tXlAuwe","duration":2710542} +{"time":"2025-08-06T23:24:47.923133+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.923141+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"6ZZBD2D3aDGwhNkE","duration":2583} +{"time":"2025-08-06T23:24:47.923152+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"6ZZBD2D3aDGwhNkE","query":"SELECT * FROM test1","args":"[]"} +{"time":"2025-08-06T23:24:47.923444+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"6ZZBD2D3aDGwhNkE","query":"SELECT * FROM test1","args":"[]","duration":285291} +{"time":"2025-08-06T23:24:47.923455+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.923464+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"6ZZBD2D3aDGwhNkE","duration":1250,"eof":false} +{"time":"2025-08-06T23:24:47.923478+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} +{"time":"2025-08-06T23:24:47.923483+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.923487+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"6ZZBD2D3aDGwhNkE","duration":84,"eof":true} +{"time":"2025-08-06T23:24:47.92349+09:00","level":"VERBOSE","msg":"Rows.Close","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.923494+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"6ZZBD2D3aDGwhNkE","duration":291} +{"time":"2025-08-06T23:24:47.9235+09:00","level":"TRACE","msg":"Conn.Close","conn_id":"6ZZBD2D3aDGwhNkE"} +{"time":"2025-08-06T23:24:47.923519+09:00","level":"INFO","msg":"Conn.Close","conn_id":"6ZZBD2D3aDGwhNkE","duration":15875} diff --git a/examples/logs-mysql/results/verbose-log.txt b/examples/logs-mysql/results/verbose-log.txt index 193d0f8..b79c3a9 100644 --- a/examples/logs-mysql/results/verbose-log.txt +++ b/examples/logs-mysql/results/verbose-log.txt @@ -1,93 +1,81 @@ -time=2025-08-06T22:41:06.697+09:00 level=TRACE msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 -time=2025-08-06T22:41:06.697+09:00 level=TRACE msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 -time=2025-08-06T22:41:06.697+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=3125 conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:06.697+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=80125 -time=2025-08-06T22:41:06.697+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:06.697+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:06.699+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=2054583 error="driver: bad connection" -time=2025-08-06T22:41:06.699+09:00 level=ERROR msg=Connector.Connect duration=2092041 error="driver: bad connection" -time=2025-08-06T22:41:06.699+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:06.699+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:06.700+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=365625 error="driver: bad connection" -time=2025-08-06T22:41:06.700+09:00 level=ERROR msg=Connector.Connect duration=376625 error="driver: bad connection" -time=2025-08-06T22:41:06.700+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:06.700+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:06.700+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=357250 error="driver: bad connection" -time=2025-08-06T22:41:06.700+09:00 level=ERROR msg=Connector.Connect duration=373833 error="driver: bad connection" -time=2025-08-06T22:41:08.701+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:08.701+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:08.703+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=2005375 error="driver: bad connection" -time=2025-08-06T22:41:08.703+09:00 level=ERROR msg=Connector.Connect duration=2120166 error="driver: bad connection" -time=2025-08-06T22:41:08.704+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:08.704+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:08.706+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=1952833 error="driver: bad connection" -time=2025-08-06T22:41:08.706+09:00 level=ERROR msg=Connector.Connect duration=2155334 error="driver: bad connection" -time=2025-08-06T22:41:08.706+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:08.706+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:08.707+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=1556000 error="driver: bad connection" -time=2025-08-06T22:41:08.708+09:00 level=ERROR msg=Connector.Connect duration=1723916 error="driver: bad connection" -time=2025-08-06T22:41:10.709+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:10.709+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:10.709+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=758125 error="driver: bad connection" -time=2025-08-06T22:41:10.709+09:00 level=ERROR msg=Connector.Connect duration=775250 error="driver: bad connection" -time=2025-08-06T22:41:10.709+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:10.709+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:10.710+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=431292 error="driver: bad connection" -time=2025-08-06T22:41:10.710+09:00 level=ERROR msg=Connector.Connect duration=440083 error="driver: bad connection" -time=2025-08-06T22:41:10.710+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:10.710+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:10.710+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=374375 error="driver: bad connection" -time=2025-08-06T22:41:10.710+09:00 level=ERROR msg=Connector.Connect duration=392875 error="driver: bad connection" -time=2025-08-06T22:41:12.712+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:12.712+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:12.717+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=2988083 error="driver: bad connection" -time=2025-08-06T22:41:12.717+09:00 level=ERROR msg=Connector.Connect duration=5088125 error="driver: bad connection" -time=2025-08-06T22:41:12.718+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:12.718+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:12.720+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=2166791 error="driver: bad connection" -time=2025-08-06T22:41:12.720+09:00 level=ERROR msg=Connector.Connect duration=2395166 error="driver: bad connection" -time=2025-08-06T22:41:12.720+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:12.720+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:12.725+09:00 level=ERROR msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=4796708 error="driver: bad connection" -time=2025-08-06T22:41:12.725+09:00 level=ERROR msg=Connector.Connect duration=4986792 error="driver: bad connection" -time=2025-08-06T22:41:14.726+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:41:14.727+09:00 level=TRACE msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.730+09:00 level=INFO msg=Connector.Connect conn_id=NhccUaPm3A5WfQIu duration=3406584 -time=2025-08-06T22:41:14.730+09:00 level=INFO msg=Connector.Connect duration=3437209 -time=2025-08-06T22:41:14.730+09:00 level=VERBOSE msg=Conn.Ping conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.731+09:00 level=TRACE msg=Conn.Ping conn_id=NhccUaPm3A5WfQIu duration=511333 -time=2025-08-06T22:41:14.731+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.731+09:00 level=TRACE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu duration=1708 -time=2025-08-06T22:41:14.731+09:00 level=TRACE msg=Conn.ExecContext conn_id=NhccUaPm3A5WfQIu query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-08-06T22:41:14.745+09:00 level=INFO msg=Conn.ExecContext conn_id=NhccUaPm3A5WfQIu query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=14602625 -time=2025-08-06T22:41:14.745+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.745+09:00 level=TRACE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu duration=1583 -time=2025-08-06T22:41:14.745+09:00 level=VERBOSE msg=Conn.Ping conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.745+09:00 level=TRACE msg=Conn.Ping conn_id=NhccUaPm3A5WfQIu duration=133958 -time=2025-08-06T22:41:14.745+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.745+09:00 level=TRACE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu duration=917 -time=2025-08-06T22:41:14.745+09:00 level=TRACE msg=Conn.BeginTx conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.746+09:00 level=INFO msg=Conn.BeginTx conn_id=NhccUaPm3A5WfQIu duration=167334 tx_id=SmI7qj1t8kCCR2SI -time=2025-08-06T22:41:14.746+09:00 level=TRACE msg=Conn.ExecContext conn_id=NhccUaPm3A5WfQIu query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" -time=2025-08-06T22:41:14.746+09:00 level=INFO msg=Conn.ExecContext conn_id=NhccUaPm3A5WfQIu query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=291 skip=true -time=2025-08-06T22:41:14.746+09:00 level=TRACE msg=Conn.PrepareContext conn_id=NhccUaPm3A5WfQIu query="INSERT INTO test1 (id, name) VALUES (?, ?)" -time=2025-08-06T22:41:14.748+09:00 level=INFO msg=Conn.PrepareContext conn_id=NhccUaPm3A5WfQIu query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=2272709 stmt_id=g5K8XWGFNrA_dPJX -time=2025-08-06T22:41:14.748+09:00 level=TRACE msg=Stmt.ExecContext conn_id=NhccUaPm3A5WfQIu stmt_id=g5K8XWGFNrA_dPJX args="[1,\"Alice\"]" -time=2025-08-06T22:41:14.748+09:00 level=INFO msg=Stmt.ExecContext conn_id=NhccUaPm3A5WfQIu stmt_id=g5K8XWGFNrA_dPJX args="[1,\"Alice\"]" duration=201958 -time=2025-08-06T22:41:14.748+09:00 level=TRACE msg=Stmt.Close conn_id=NhccUaPm3A5WfQIu stmt_id=g5K8XWGFNrA_dPJX -time=2025-08-06T22:41:14.748+09:00 level=INFO msg=Stmt.Close conn_id=NhccUaPm3A5WfQIu stmt_id=g5K8XWGFNrA_dPJX duration=4958 -time=2025-08-06T22:41:14.748+09:00 level=TRACE msg=Tx.Commit conn_id=NhccUaPm3A5WfQIu tx_id=SmI7qj1t8kCCR2SI -time=2025-08-06T22:41:14.749+09:00 level=INFO msg=Tx.Commit conn_id=NhccUaPm3A5WfQIu tx_id=SmI7qj1t8kCCR2SI duration=984500 -time=2025-08-06T22:41:14.749+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.749+09:00 level=TRACE msg=Conn.ResetSession conn_id=NhccUaPm3A5WfQIu duration=1125 -time=2025-08-06T22:41:14.749+09:00 level=TRACE msg=Conn.QueryContext conn_id=NhccUaPm3A5WfQIu query="SELECT * FROM test1" args=[] -time=2025-08-06T22:41:14.749+09:00 level=DEBUG msg=Conn.QueryContext conn_id=NhccUaPm3A5WfQIu query="SELECT * FROM test1" args=[] duration=201958 -time=2025-08-06T22:41:14.749+09:00 level=VERBOSE msg=Rows.Next conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.749+09:00 level=DEBUG msg=Rows.Next conn_id=NhccUaPm3A5WfQIu duration=1083 eof=false -time=2025-08-06T22:41:14.749+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:41:14.749+09:00 level=VERBOSE msg=Rows.Next conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.749+09:00 level=DEBUG msg=Rows.Next conn_id=NhccUaPm3A5WfQIu duration=83 eof=true -time=2025-08-06T22:41:14.749+09:00 level=VERBOSE msg=Rows.Close conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.749+09:00 level=DEBUG msg=Rows.Close conn_id=NhccUaPm3A5WfQIu duration=84 -time=2025-08-06T22:41:14.749+09:00 level=TRACE msg=Conn.Close conn_id=NhccUaPm3A5WfQIu -time=2025-08-06T22:41:14.749+09:00 level=INFO msg=Conn.Close conn_id=NhccUaPm3A5WfQIu duration=13833 +time=2025-08-06T23:24:33.949+09:00 level=TRACE msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 +time=2025-08-06T23:24:33.949+09:00 level=TRACE msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 +time=2025-08-06T23:24:33.949+09:00 level=INFO msg=Driver.OpenConnector dsn=root@tcp(localhost:3306)/app1 duration=1792 conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:33.949+09:00 level=INFO msg=Open driver=mysql dsn=root@tcp(localhost:3306)/app1 duration=42583 +time=2025-08-06T23:24:33.949+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:33.949+09:00 level=TRACE msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:33.952+09:00 level=ERROR msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua duration=2480125 error="driver: bad connection" +time=2025-08-06T23:24:33.952+09:00 level=ERROR msg=Connector.Connect duration=2506625 error="driver: bad connection" +time=2025-08-06T23:24:33.952+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:33.952+09:00 level=TRACE msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:33.952+09:00 level=ERROR msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua duration=563084 error="driver: bad connection" +time=2025-08-06T23:24:33.952+09:00 level=ERROR msg=Connector.Connect duration=582000 error="driver: bad connection" +time=2025-08-06T23:24:33.952+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:33.952+09:00 level=TRACE msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:33.953+09:00 level=ERROR msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua duration=513250 error="driver: bad connection" +time=2025-08-06T23:24:33.953+09:00 level=ERROR msg=Connector.Connect duration=540334 error="driver: bad connection" +time=2025-08-06T23:24:35.954+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:35.954+09:00 level=TRACE msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:35.955+09:00 level=ERROR msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua duration=922667 error="driver: bad connection" +time=2025-08-06T23:24:35.955+09:00 level=ERROR msg=Connector.Connect duration=1008291 error="driver: bad connection" +time=2025-08-06T23:24:35.955+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:35.955+09:00 level=TRACE msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:35.956+09:00 level=ERROR msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua duration=707417 error="driver: bad connection" +time=2025-08-06T23:24:35.956+09:00 level=ERROR msg=Connector.Connect duration=752917 error="driver: bad connection" +time=2025-08-06T23:24:35.956+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:35.956+09:00 level=TRACE msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:35.956+09:00 level=ERROR msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua duration=480584 error="driver: bad connection" +time=2025-08-06T23:24:35.956+09:00 level=ERROR msg=Connector.Connect duration=521292 error="driver: bad connection" +time=2025-08-06T23:24:37.957+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:37.957+09:00 level=TRACE msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:37.960+09:00 level=ERROR msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua duration=2992167 error="driver: bad connection" +time=2025-08-06T23:24:37.960+09:00 level=ERROR msg=Connector.Connect duration=3058083 error="driver: bad connection" +time=2025-08-06T23:24:37.960+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:37.960+09:00 level=TRACE msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:37.961+09:00 level=ERROR msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua duration=1053416 error="driver: bad connection" +time=2025-08-06T23:24:37.961+09:00 level=ERROR msg=Connector.Connect duration=1084000 error="driver: bad connection" +time=2025-08-06T23:24:37.961+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:37.961+09:00 level=TRACE msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:37.962+09:00 level=ERROR msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua duration=466333 error="driver: bad connection" +time=2025-08-06T23:24:37.962+09:00 level=ERROR msg=Connector.Connect duration=485625 error="driver: bad connection" +time=2025-08-06T23:24:39.963+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:39.963+09:00 level=TRACE msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.966+09:00 level=INFO msg=Connector.Connect conn_id=4a8TXRbcAWVHSvua duration=3371958 +time=2025-08-06T23:24:39.966+09:00 level=INFO msg=Connector.Connect duration=3437125 +time=2025-08-06T23:24:39.966+09:00 level=VERBOSE msg=Conn.Ping conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.967+09:00 level=TRACE msg=Conn.Ping conn_id=4a8TXRbcAWVHSvua duration=332417 +time=2025-08-06T23:24:39.967+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.967+09:00 level=TRACE msg=Conn.ResetSession conn_id=4a8TXRbcAWVHSvua duration=3084 +time=2025-08-06T23:24:39.967+09:00 level=TRACE msg=Conn.ExecContext conn_id=4a8TXRbcAWVHSvua query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T23:24:39.983+09:00 level=INFO msg=Conn.ExecContext conn_id=4a8TXRbcAWVHSvua query="CREATE TABLE IF NOT EXISTS test1 (id INT PRIMARY KEY, name VARCHAR(255))" args=[] duration=16739166 +time=2025-08-06T23:24:39.983+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.983+09:00 level=TRACE msg=Conn.ResetSession conn_id=4a8TXRbcAWVHSvua duration=2541 +time=2025-08-06T23:24:39.983+09:00 level=VERBOSE msg=Conn.Ping conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.984+09:00 level=TRACE msg=Conn.Ping conn_id=4a8TXRbcAWVHSvua duration=339666 +time=2025-08-06T23:24:39.984+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.984+09:00 level=TRACE msg=Conn.ResetSession conn_id=4a8TXRbcAWVHSvua duration=1709 +time=2025-08-06T23:24:39.984+09:00 level=TRACE msg=Conn.BeginTx conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.984+09:00 level=INFO msg=Conn.BeginTx conn_id=4a8TXRbcAWVHSvua duration=345834 tx_id=XBXE_cuLi29Uelvm +time=2025-08-06T23:24:39.984+09:00 level=TRACE msg=Conn.ExecContext conn_id=4a8TXRbcAWVHSvua query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" +time=2025-08-06T23:24:39.984+09:00 level=INFO msg=Conn.ExecContext conn_id=4a8TXRbcAWVHSvua query="INSERT INTO test1 (id, name) VALUES (?, ?)" args="[1,\"Alice\"]" duration=750 skip=true +time=2025-08-06T23:24:39.984+09:00 level=VERBOSE msg=Conn.PrepareContext conn_id=4a8TXRbcAWVHSvua query="INSERT INTO test1 (id, name) VALUES (?, ?)" +time=2025-08-06T23:24:39.989+09:00 level=TRACE msg=Conn.PrepareContext conn_id=4a8TXRbcAWVHSvua query="INSERT INTO test1 (id, name) VALUES (?, ?)" duration=5120166 stmt_id=k5sjvbiyBnPBBGl7 +time=2025-08-06T23:24:39.989+09:00 level=VERBOSE msg=Stmt.ExecContext conn_id=4a8TXRbcAWVHSvua stmt_id=k5sjvbiyBnPBBGl7 args="[1,\"Alice\"]" +time=2025-08-06T23:24:39.990+09:00 level=DEBUG msg=Stmt.ExecContext conn_id=4a8TXRbcAWVHSvua stmt_id=k5sjvbiyBnPBBGl7 args="[1,\"Alice\"]" duration=339000 +time=2025-08-06T23:24:39.990+09:00 level=VERBOSE msg=Stmt.Close conn_id=4a8TXRbcAWVHSvua stmt_id=k5sjvbiyBnPBBGl7 +time=2025-08-06T23:24:39.990+09:00 level=DEBUG msg=Stmt.Close conn_id=4a8TXRbcAWVHSvua stmt_id=k5sjvbiyBnPBBGl7 duration=5709 +time=2025-08-06T23:24:39.990+09:00 level=TRACE msg=Tx.Commit conn_id=4a8TXRbcAWVHSvua tx_id=XBXE_cuLi29Uelvm +time=2025-08-06T23:24:39.991+09:00 level=INFO msg=Tx.Commit conn_id=4a8TXRbcAWVHSvua tx_id=XBXE_cuLi29Uelvm duration=1433625 +time=2025-08-06T23:24:39.991+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.991+09:00 level=TRACE msg=Conn.ResetSession conn_id=4a8TXRbcAWVHSvua duration=2792 +time=2025-08-06T23:24:39.991+09:00 level=TRACE msg=Conn.QueryContext conn_id=4a8TXRbcAWVHSvua query="SELECT * FROM test1" args=[] +time=2025-08-06T23:24:39.992+09:00 level=DEBUG msg=Conn.QueryContext conn_id=4a8TXRbcAWVHSvua query="SELECT * FROM test1" args=[] duration=364875 +time=2025-08-06T23:24:39.992+09:00 level=VERBOSE msg=Rows.Next conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.992+09:00 level=DEBUG msg=Rows.Next conn_id=4a8TXRbcAWVHSvua duration=2458 eof=false +time=2025-08-06T23:24:39.992+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:24:39.992+09:00 level=VERBOSE msg=Rows.Next conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.992+09:00 level=DEBUG msg=Rows.Next conn_id=4a8TXRbcAWVHSvua duration=208 eof=true +time=2025-08-06T23:24:39.992+09:00 level=VERBOSE msg=Rows.Close conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.992+09:00 level=DEBUG msg=Rows.Close conn_id=4a8TXRbcAWVHSvua duration=208 +time=2025-08-06T23:24:39.992+09:00 level=TRACE msg=Conn.Close conn_id=4a8TXRbcAWVHSvua +time=2025-08-06T23:24:39.992+09:00 level=INFO msg=Conn.Close conn_id=4a8TXRbcAWVHSvua duration=26541 diff --git a/examples/logs-postgres/results/debug-log.txt b/examples/logs-postgres/results/debug-log.txt index b21510c..07a8dfb 100644 --- a/examples/logs-postgres/results/debug-log.txt +++ b/examples/logs-postgres/results/debug-log.txt @@ -1,15 +1,15 @@ -time=2025-08-06T22:40:27.499+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=23458 -time=2025-08-06T22:40:27.500+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=852166 error="read tcp 127.0.0.1:60341->127.0.0.1:5432: read: connection reset by peer" -time=2025-08-06T22:40:27.500+09:00 level=ERROR msg=Connector.Connect duration=884416 error="read tcp 127.0.0.1:60341->127.0.0.1:5432: read: connection reset by peer" -time=2025-08-06T22:40:29.515+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=13052417 conn_id=ZFcUurxb9Qs5tU0L -time=2025-08-06T22:40:29.515+09:00 level=INFO msg=Connector.Connect duration=13224792 -time=2025-08-06T22:40:29.520+09:00 level=INFO msg=Conn.ExecContext conn_id=ZFcUurxb9Qs5tU0L query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=5166416 -time=2025-08-06T22:40:29.521+09:00 level=INFO msg=Conn.BeginTx conn_id=ZFcUurxb9Qs5tU0L duration=270792 tx_id=Lz1tuNPUCXsPMUbn -time=2025-08-06T22:40:29.522+09:00 level=INFO msg=Conn.ExecContext conn_id=ZFcUurxb9Qs5tU0L query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=1217792 -time=2025-08-06T22:40:29.523+09:00 level=INFO msg=Tx.Commit conn_id=ZFcUurxb9Qs5tU0L tx_id=Lz1tuNPUCXsPMUbn duration=702792 -time=2025-08-06T22:40:29.524+09:00 level=DEBUG msg=Conn.QueryContext conn_id=ZFcUurxb9Qs5tU0L query="SELECT * FROM test1" args=[] duration=378208 -time=2025-08-06T22:40:29.524+09:00 level=DEBUG msg=Rows.Next conn_id=ZFcUurxb9Qs5tU0L duration=1917 eof=false -time=2025-08-06T22:40:29.524+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:40:29.524+09:00 level=DEBUG msg=Rows.Next conn_id=ZFcUurxb9Qs5tU0L duration=1208 eof=true -time=2025-08-06T22:40:29.524+09:00 level=DEBUG msg=Rows.Close conn_id=ZFcUurxb9Qs5tU0L duration=292 -time=2025-08-06T22:40:29.524+09:00 level=INFO msg=Conn.Close conn_id=ZFcUurxb9Qs5tU0L duration=26709 +time=2025-08-06T23:23:56.128+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=68750 +time=2025-08-06T23:23:56.129+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=788500 error="read tcp 127.0.0.1:61635->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T23:23:56.129+09:00 level=ERROR msg=Connector.Connect duration=819625 error="read tcp 127.0.0.1:61635->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T23:23:58.139+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=9617292 conn_id=R7iQY28Osd_CJyuz +time=2025-08-06T23:23:58.139+09:00 level=INFO msg=Connector.Connect duration=9788167 +time=2025-08-06T23:23:58.144+09:00 level=INFO msg=Conn.ExecContext conn_id=R7iQY28Osd_CJyuz query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=3789375 +time=2025-08-06T23:23:58.144+09:00 level=INFO msg=Conn.BeginTx conn_id=R7iQY28Osd_CJyuz duration=288792 tx_id=ACeDDgjkccTVtwMr +time=2025-08-06T23:23:58.145+09:00 level=INFO msg=Conn.ExecContext conn_id=R7iQY28Osd_CJyuz query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=1136667 +time=2025-08-06T23:23:58.146+09:00 level=INFO msg=Tx.Commit conn_id=R7iQY28Osd_CJyuz tx_id=ACeDDgjkccTVtwMr duration=774750 +time=2025-08-06T23:23:58.147+09:00 level=DEBUG msg=Conn.QueryContext conn_id=R7iQY28Osd_CJyuz query="SELECT * FROM test1" args=[] duration=392292 +time=2025-08-06T23:23:58.147+09:00 level=DEBUG msg=Rows.Next conn_id=R7iQY28Osd_CJyuz duration=1584 eof=false +time=2025-08-06T23:23:58.147+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:23:58.147+09:00 level=DEBUG msg=Rows.Next conn_id=R7iQY28Osd_CJyuz duration=583 eof=true +time=2025-08-06T23:23:58.147+09:00 level=DEBUG msg=Rows.Close conn_id=R7iQY28Osd_CJyuz duration=42 +time=2025-08-06T23:23:58.147+09:00 level=INFO msg=Conn.Close conn_id=R7iQY28Osd_CJyuz duration=17459 diff --git a/examples/logs-postgres/results/info-log.txt b/examples/logs-postgres/results/info-log.txt index 82057c6..bd69b2d 100644 --- a/examples/logs-postgres/results/info-log.txt +++ b/examples/logs-postgres/results/info-log.txt @@ -1,11 +1,11 @@ -time=2025-08-06T22:40:24.644+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=229875 -time=2025-08-06T22:40:24.646+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=842917 error="read tcp 127.0.0.1:60337->127.0.0.1:5432: read: connection reset by peer" -time=2025-08-06T22:40:24.646+09:00 level=ERROR msg=Connector.Connect duration=893667 error="read tcp 127.0.0.1:60337->127.0.0.1:5432: read: connection reset by peer" -time=2025-08-06T22:40:26.663+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=16437167 conn_id=U4NQPudl0qNw06Hz -time=2025-08-06T22:40:26.663+09:00 level=INFO msg=Connector.Connect duration=16707208 -time=2025-08-06T22:40:26.671+09:00 level=INFO msg=Conn.ExecContext conn_id=U4NQPudl0qNw06Hz query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=5529125 -time=2025-08-06T22:40:26.672+09:00 level=INFO msg=Conn.BeginTx conn_id=U4NQPudl0qNw06Hz duration=381042 tx_id=yerAEJXh4rijpBsd -time=2025-08-06T22:40:26.673+09:00 level=INFO msg=Conn.ExecContext conn_id=U4NQPudl0qNw06Hz query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=1354875 -time=2025-08-06T22:40:26.674+09:00 level=INFO msg=Tx.Commit conn_id=U4NQPudl0qNw06Hz tx_id=yerAEJXh4rijpBsd duration=775292 -time=2025-08-06T22:40:26.675+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:40:26.675+09:00 level=INFO msg=Conn.Close conn_id=U4NQPudl0qNw06Hz duration=28042 +time=2025-08-06T23:23:53.060+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=76416 +time=2025-08-06T23:23:53.061+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=605917 error="read tcp 127.0.0.1:61632->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T23:23:53.061+09:00 level=ERROR msg=Connector.Connect duration=635333 error="read tcp 127.0.0.1:61632->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T23:23:55.081+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=18800167 conn_id=DND7Y_XZmy77URni +time=2025-08-06T23:23:55.081+09:00 level=INFO msg=Connector.Connect duration=19007083 +time=2025-08-06T23:23:55.085+09:00 level=INFO msg=Conn.ExecContext conn_id=DND7Y_XZmy77URni query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=3010292 +time=2025-08-06T23:23:55.086+09:00 level=INFO msg=Conn.BeginTx conn_id=DND7Y_XZmy77URni duration=297875 tx_id=W2A2VLIfqrhlDGJG +time=2025-08-06T23:23:55.087+09:00 level=INFO msg=Conn.ExecContext conn_id=DND7Y_XZmy77URni query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=1336083 +time=2025-08-06T23:23:55.088+09:00 level=INFO msg=Tx.Commit conn_id=DND7Y_XZmy77URni tx_id=W2A2VLIfqrhlDGJG duration=682875 +time=2025-08-06T23:23:55.088+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:23:55.088+09:00 level=INFO msg=Conn.Close conn_id=DND7Y_XZmy77URni duration=17250 diff --git a/examples/logs-postgres/results/trace-log.txt b/examples/logs-postgres/results/trace-log.txt index 85bca4a..cfa6f2f 100644 --- a/examples/logs-postgres/results/trace-log.txt +++ b/examples/logs-postgres/results/trace-log.txt @@ -1,32 +1,32 @@ -time=2025-08-06T22:40:30.327+09:00 level=TRACE msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-08-06T22:40:30.327+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=13208 -time=2025-08-06T22:40:30.327+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:30.327+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-08-06T22:40:30.328+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=524791 error="read tcp 127.0.0.1:60343->127.0.0.1:5432: read: connection reset by peer" -time=2025-08-06T22:40:30.328+09:00 level=ERROR msg=Connector.Connect duration=553417 error="read tcp 127.0.0.1:60343->127.0.0.1:5432: read: connection reset by peer" -time=2025-08-06T22:40:32.329+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:32.329+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-08-06T22:40:32.340+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=10913667 conn_id=30X84QrXocW6G2sZ -time=2025-08-06T22:40:32.340+09:00 level=INFO msg=Connector.Connect duration=10987750 -time=2025-08-06T22:40:32.341+09:00 level=TRACE msg=Conn.Ping conn_id=30X84QrXocW6G2sZ duration=451959 -time=2025-08-06T22:40:32.341+09:00 level=TRACE msg=Conn.ResetSession conn_id=30X84QrXocW6G2sZ duration=1000 -time=2025-08-06T22:40:32.341+09:00 level=TRACE msg=Conn.ExecContext conn_id=30X84QrXocW6G2sZ query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-08-06T22:40:32.345+09:00 level=INFO msg=Conn.ExecContext conn_id=30X84QrXocW6G2sZ query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=4199417 -time=2025-08-06T22:40:32.345+09:00 level=TRACE msg=Conn.ResetSession conn_id=30X84QrXocW6G2sZ duration=417 -time=2025-08-06T22:40:32.346+09:00 level=TRACE msg=Conn.Ping conn_id=30X84QrXocW6G2sZ duration=254500 -time=2025-08-06T22:40:32.346+09:00 level=TRACE msg=Conn.ResetSession conn_id=30X84QrXocW6G2sZ duration=125 -time=2025-08-06T22:40:32.346+09:00 level=TRACE msg=Conn.BeginTx conn_id=30X84QrXocW6G2sZ -time=2025-08-06T22:40:32.346+09:00 level=INFO msg=Conn.BeginTx conn_id=30X84QrXocW6G2sZ duration=217583 tx_id=rZTywSUdDNra9_7h -time=2025-08-06T22:40:32.346+09:00 level=TRACE msg=Conn.ExecContext conn_id=30X84QrXocW6G2sZ query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" -time=2025-08-06T22:40:32.347+09:00 level=INFO msg=Conn.ExecContext conn_id=30X84QrXocW6G2sZ query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=1226083 -time=2025-08-06T22:40:32.347+09:00 level=TRACE msg=Tx.Commit conn_id=30X84QrXocW6G2sZ tx_id=rZTywSUdDNra9_7h -time=2025-08-06T22:40:32.348+09:00 level=INFO msg=Tx.Commit conn_id=30X84QrXocW6G2sZ tx_id=rZTywSUdDNra9_7h duration=623708 -time=2025-08-06T22:40:32.348+09:00 level=TRACE msg=Conn.ResetSession conn_id=30X84QrXocW6G2sZ duration=292 -time=2025-08-06T22:40:32.348+09:00 level=TRACE msg=Conn.QueryContext conn_id=30X84QrXocW6G2sZ query="SELECT * FROM test1" args=[] -time=2025-08-06T22:40:32.349+09:00 level=DEBUG msg=Conn.QueryContext conn_id=30X84QrXocW6G2sZ query="SELECT * FROM test1" args=[] duration=578792 -time=2025-08-06T22:40:32.349+09:00 level=DEBUG msg=Rows.Next conn_id=30X84QrXocW6G2sZ duration=2000 eof=false -time=2025-08-06T22:40:32.349+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:40:32.349+09:00 level=DEBUG msg=Rows.Next conn_id=30X84QrXocW6G2sZ duration=1084 eof=true -time=2025-08-06T22:40:32.349+09:00 level=DEBUG msg=Rows.Close conn_id=30X84QrXocW6G2sZ duration=208 -time=2025-08-06T22:40:32.349+09:00 level=TRACE msg=Conn.Close conn_id=30X84QrXocW6G2sZ -time=2025-08-06T22:40:32.349+09:00 level=INFO msg=Conn.Close conn_id=30X84QrXocW6G2sZ duration=23500 +time=2025-08-06T23:23:58.972+09:00 level=TRACE msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T23:23:58.973+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=14875 +time=2025-08-06T23:23:58.973+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:23:58.973+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T23:23:58.973+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=546958 error="read tcp 127.0.0.1:61639->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T23:23:58.973+09:00 level=ERROR msg=Connector.Connect duration=570666 error="read tcp 127.0.0.1:61639->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T23:24:00.974+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:00.975+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T23:24:00.992+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=17226250 conn_id=brVzLT_MX4DoRbYL +time=2025-08-06T23:24:00.992+09:00 level=INFO msg=Connector.Connect duration=17481583 +time=2025-08-06T23:24:00.993+09:00 level=TRACE msg=Conn.Ping conn_id=brVzLT_MX4DoRbYL duration=615167 +time=2025-08-06T23:24:00.993+09:00 level=TRACE msg=Conn.ResetSession conn_id=brVzLT_MX4DoRbYL duration=1250 +time=2025-08-06T23:24:00.993+09:00 level=TRACE msg=Conn.ExecContext conn_id=brVzLT_MX4DoRbYL query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T23:24:00.997+09:00 level=INFO msg=Conn.ExecContext conn_id=brVzLT_MX4DoRbYL query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=4647250 +time=2025-08-06T23:24:00.998+09:00 level=TRACE msg=Conn.ResetSession conn_id=brVzLT_MX4DoRbYL duration=708 +time=2025-08-06T23:24:00.998+09:00 level=TRACE msg=Conn.Ping conn_id=brVzLT_MX4DoRbYL duration=313209 +time=2025-08-06T23:24:00.998+09:00 level=TRACE msg=Conn.ResetSession conn_id=brVzLT_MX4DoRbYL duration=166 +time=2025-08-06T23:24:00.998+09:00 level=TRACE msg=Conn.BeginTx conn_id=brVzLT_MX4DoRbYL +time=2025-08-06T23:24:00.998+09:00 level=INFO msg=Conn.BeginTx conn_id=brVzLT_MX4DoRbYL duration=302167 tx_id=VyFX1vwTC50lUJKd +time=2025-08-06T23:24:00.998+09:00 level=TRACE msg=Conn.ExecContext conn_id=brVzLT_MX4DoRbYL query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" +time=2025-08-06T23:24:01.000+09:00 level=INFO msg=Conn.ExecContext conn_id=brVzLT_MX4DoRbYL query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=1190209 +time=2025-08-06T23:24:01.000+09:00 level=TRACE msg=Tx.Commit conn_id=brVzLT_MX4DoRbYL tx_id=VyFX1vwTC50lUJKd +time=2025-08-06T23:24:01.001+09:00 level=INFO msg=Tx.Commit conn_id=brVzLT_MX4DoRbYL tx_id=VyFX1vwTC50lUJKd duration=1004709 +time=2025-08-06T23:24:01.001+09:00 level=TRACE msg=Conn.ResetSession conn_id=brVzLT_MX4DoRbYL duration=459 +time=2025-08-06T23:24:01.001+09:00 level=TRACE msg=Conn.QueryContext conn_id=brVzLT_MX4DoRbYL query="SELECT * FROM test1" args=[] +time=2025-08-06T23:24:01.001+09:00 level=DEBUG msg=Conn.QueryContext conn_id=brVzLT_MX4DoRbYL query="SELECT * FROM test1" args=[] duration=715958 +time=2025-08-06T23:24:01.002+09:00 level=DEBUG msg=Rows.Next conn_id=brVzLT_MX4DoRbYL duration=3625 eof=false +time=2025-08-06T23:24:01.002+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:24:01.002+09:00 level=DEBUG msg=Rows.Next conn_id=brVzLT_MX4DoRbYL duration=2417 eof=true +time=2025-08-06T23:24:01.002+09:00 level=DEBUG msg=Rows.Close conn_id=brVzLT_MX4DoRbYL duration=584 +time=2025-08-06T23:24:01.002+09:00 level=TRACE msg=Conn.Close conn_id=brVzLT_MX4DoRbYL +time=2025-08-06T23:24:01.002+09:00 level=INFO msg=Conn.Close conn_id=brVzLT_MX4DoRbYL duration=56250 diff --git a/examples/logs-postgres/results/verbose-log.json b/examples/logs-postgres/results/verbose-log.json index 49da644..a7b732c 100644 --- a/examples/logs-postgres/results/verbose-log.json +++ b/examples/logs-postgres/results/verbose-log.json @@ -1,41 +1,41 @@ -{"time":"2025-08-06T22:40:36.017699+09:00","level":"TRACE","msg":"Open","driver":"postgres","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} -{"time":"2025-08-06T22:40:36.017843+09:00","level":"INFO","msg":"Open","driver":"postgres","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":13958} -{"time":"2025-08-06T22:40:36.017849+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:40:36.017856+09:00","level":"TRACE","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} -{"time":"2025-08-06T22:40:36.018562+09:00","level":"ERROR","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":697875,"error":"read tcp 127.0.0.1:60349->127.0.0.1:5432: read: connection reset by peer"} -{"time":"2025-08-06T22:40:36.01858+09:00","level":"ERROR","msg":"Connector.Connect","duration":727583,"error":"read tcp 127.0.0.1:60349->127.0.0.1:5432: read: connection reset by peer"} -{"time":"2025-08-06T22:40:38.018707+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:40:38.018795+09:00","level":"TRACE","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} -{"time":"2025-08-06T22:40:38.02277+09:00","level":"INFO","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":3963625,"conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.022784+09:00","level":"INFO","msg":"Connector.Connect","duration":3996042} -{"time":"2025-08-06T22:40:38.022794+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.022967+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"p5IExrJONBaSJPAk","duration":168208} -{"time":"2025-08-06T22:40:38.022974+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.022977+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk","duration":333} -{"time":"2025-08-06T22:40:38.022981+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"p5IExrJONBaSJPAk","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]"} -{"time":"2025-08-06T22:40:38.024357+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"p5IExrJONBaSJPAk","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":1370917} -{"time":"2025-08-06T22:40:38.024369+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.024373+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk","duration":166} -{"time":"2025-08-06T22:40:38.024377+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.024541+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"p5IExrJONBaSJPAk","duration":160292} -{"time":"2025-08-06T22:40:38.024548+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.024552+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk","duration":125} -{"time":"2025-08-06T22:40:38.024557+09:00","level":"TRACE","msg":"Conn.BeginTx","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.024709+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"p5IExrJONBaSJPAk","duration":148667,"tx_id":"GMkNXpT_hc_gW8yf"} -{"time":"2025-08-06T22:40:38.024725+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"p5IExrJONBaSJPAk","query":"INSERT INTO test1 (id, name) VALUES ($1,$2);","args":"[1,\"Alice\"]"} -{"time":"2025-08-06T22:40:38.025183+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"p5IExrJONBaSJPAk","query":"INSERT INTO test1 (id, name) VALUES ($1,$2);","args":"[1,\"Alice\"]","duration":448041} -{"time":"2025-08-06T22:40:38.025195+09:00","level":"TRACE","msg":"Tx.Commit","conn_id":"p5IExrJONBaSJPAk","tx_id":"GMkNXpT_hc_gW8yf"} -{"time":"2025-08-06T22:40:38.025433+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"p5IExrJONBaSJPAk","tx_id":"GMkNXpT_hc_gW8yf","duration":224708} -{"time":"2025-08-06T22:40:38.025437+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.025441+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"p5IExrJONBaSJPAk","duration":84} -{"time":"2025-08-06T22:40:38.025453+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"p5IExrJONBaSJPAk","query":"SELECT * FROM test1","args":"[]"} -{"time":"2025-08-06T22:40:38.025609+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"p5IExrJONBaSJPAk","query":"SELECT * FROM test1","args":"[]","duration":151125} -{"time":"2025-08-06T22:40:38.025615+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.025619+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"p5IExrJONBaSJPAk","duration":750,"eof":false} -{"time":"2025-08-06T22:40:38.025627+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} -{"time":"2025-08-06T22:40:38.02563+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.025633+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"p5IExrJONBaSJPAk","duration":417,"eof":true} -{"time":"2025-08-06T22:40:38.025636+09:00","level":"VERBOSE","msg":"Rows.Close","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.025638+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"p5IExrJONBaSJPAk","duration":84} -{"time":"2025-08-06T22:40:38.025642+09:00","level":"TRACE","msg":"Conn.Close","conn_id":"p5IExrJONBaSJPAk"} -{"time":"2025-08-06T22:40:38.025655+09:00","level":"INFO","msg":"Conn.Close","conn_id":"p5IExrJONBaSJPAk","duration":9750} +{"time":"2025-08-06T23:24:04.554997+09:00","level":"TRACE","msg":"Open","driver":"postgres","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} +{"time":"2025-08-06T23:24:04.555138+09:00","level":"INFO","msg":"Open","driver":"postgres","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":12916} +{"time":"2025-08-06T23:24:04.555143+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:04.555151+09:00","level":"TRACE","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} +{"time":"2025-08-06T23:24:04.555738+09:00","level":"ERROR","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":579875,"error":"read tcp 127.0.0.1:61648->127.0.0.1:5432: read: connection reset by peer"} +{"time":"2025-08-06T23:24:04.55575+09:00","level":"ERROR","msg":"Connector.Connect","duration":603208,"error":"read tcp 127.0.0.1:61648->127.0.0.1:5432: read: connection reset by peer"} +{"time":"2025-08-06T23:24:06.556979+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:24:06.55746+09:00","level":"TRACE","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable"} +{"time":"2025-08-06T23:24:06.577368+09:00","level":"INFO","msg":"Driver.Open","dsn":"host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable","duration":19805625,"conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.577485+09:00","level":"INFO","msg":"Connector.Connect","duration":20099625} +{"time":"2025-08-06T23:24:06.577564+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.578624+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"b1n_lbHcZoZNvvGM","duration":1006917} +{"time":"2025-08-06T23:24:06.578728+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.578778+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"b1n_lbHcZoZNvvGM","duration":1417} +{"time":"2025-08-06T23:24:06.578824+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"b1n_lbHcZoZNvvGM","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]"} +{"time":"2025-08-06T23:24:06.586314+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"b1n_lbHcZoZNvvGM","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":7430708} +{"time":"2025-08-06T23:24:06.586417+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.586452+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"b1n_lbHcZoZNvvGM","duration":1000} +{"time":"2025-08-06T23:24:06.586476+09:00","level":"VERBOSE","msg":"Conn.Ping","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.587181+09:00","level":"TRACE","msg":"Conn.Ping","conn_id":"b1n_lbHcZoZNvvGM","duration":678208} +{"time":"2025-08-06T23:24:06.587244+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.587271+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"b1n_lbHcZoZNvvGM","duration":500} +{"time":"2025-08-06T23:24:06.587295+09:00","level":"TRACE","msg":"Conn.BeginTx","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.587763+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"b1n_lbHcZoZNvvGM","duration":452750,"tx_id":"dtuWOqXSssYXMdST"} +{"time":"2025-08-06T23:24:06.58783+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"b1n_lbHcZoZNvvGM","query":"INSERT INTO test1 (id, name) VALUES ($1,$2);","args":"[1,\"Alice\"]"} +{"time":"2025-08-06T23:24:06.589123+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"b1n_lbHcZoZNvvGM","query":"INSERT INTO test1 (id, name) VALUES ($1,$2);","args":"[1,\"Alice\"]","duration":1276375} +{"time":"2025-08-06T23:24:06.589214+09:00","level":"TRACE","msg":"Tx.Commit","conn_id":"b1n_lbHcZoZNvvGM","tx_id":"dtuWOqXSssYXMdST"} +{"time":"2025-08-06T23:24:06.58994+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"b1n_lbHcZoZNvvGM","tx_id":"dtuWOqXSssYXMdST","duration":674417} +{"time":"2025-08-06T23:24:06.589965+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.589976+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"b1n_lbHcZoZNvvGM","duration":334} +{"time":"2025-08-06T23:24:06.589992+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"b1n_lbHcZoZNvvGM","query":"SELECT * FROM test1","args":"[]"} +{"time":"2025-08-06T23:24:06.590399+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"b1n_lbHcZoZNvvGM","query":"SELECT * FROM test1","args":"[]","duration":398375} +{"time":"2025-08-06T23:24:06.590422+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.590449+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"b1n_lbHcZoZNvvGM","duration":3083,"eof":false} +{"time":"2025-08-06T23:24:06.590481+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} +{"time":"2025-08-06T23:24:06.5905+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.590509+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"b1n_lbHcZoZNvvGM","duration":1292,"eof":true} +{"time":"2025-08-06T23:24:06.590518+09:00","level":"VERBOSE","msg":"Rows.Close","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.590525+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"b1n_lbHcZoZNvvGM","duration":334} +{"time":"2025-08-06T23:24:06.590539+09:00","level":"TRACE","msg":"Conn.Close","conn_id":"b1n_lbHcZoZNvvGM"} +{"time":"2025-08-06T23:24:06.590575+09:00","level":"INFO","msg":"Conn.Close","conn_id":"b1n_lbHcZoZNvvGM","duration":30167} diff --git a/examples/logs-postgres/results/verbose-log.txt b/examples/logs-postgres/results/verbose-log.txt index 11c8dff..10cb3f1 100644 --- a/examples/logs-postgres/results/verbose-log.txt +++ b/examples/logs-postgres/results/verbose-log.txt @@ -1,41 +1,41 @@ -time=2025-08-06T22:40:33.195+09:00 level=TRACE msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-08-06T22:40:33.195+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=15292 -time=2025-08-06T22:40:33.195+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:33.195+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-08-06T22:40:33.197+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=1542000 error="read tcp 127.0.0.1:60345->127.0.0.1:5432: read: connection reset by peer" -time=2025-08-06T22:40:33.197+09:00 level=ERROR msg=Connector.Connect duration=1590708 error="read tcp 127.0.0.1:60345->127.0.0.1:5432: read: connection reset by peer" -time=2025-08-06T22:40:35.198+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:35.198+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" -time=2025-08-06T22:40:35.206+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=7551083 conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.206+09:00 level=INFO msg=Connector.Connect duration=7620959 -time=2025-08-06T22:40:35.206+09:00 level=VERBOSE msg=Conn.Ping conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.206+09:00 level=TRACE msg=Conn.Ping conn_id=a585Q3ZDe7vga5RV duration=257542 -time=2025-08-06T22:40:35.206+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.206+09:00 level=TRACE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV duration=625 -time=2025-08-06T22:40:35.206+09:00 level=TRACE msg=Conn.ExecContext conn_id=a585Q3ZDe7vga5RV query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-08-06T22:40:35.210+09:00 level=INFO msg=Conn.ExecContext conn_id=a585Q3ZDe7vga5RV query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=4340292 -time=2025-08-06T22:40:35.210+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.210+09:00 level=TRACE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV duration=292 -time=2025-08-06T22:40:35.210+09:00 level=VERBOSE msg=Conn.Ping conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.211+09:00 level=TRACE msg=Conn.Ping conn_id=a585Q3ZDe7vga5RV duration=264083 -time=2025-08-06T22:40:35.211+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.211+09:00 level=TRACE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV duration=208 -time=2025-08-06T22:40:35.211+09:00 level=TRACE msg=Conn.BeginTx conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.211+09:00 level=INFO msg=Conn.BeginTx conn_id=a585Q3ZDe7vga5RV duration=214208 tx_id=rj3Frb9Lcjoq1emJ -time=2025-08-06T22:40:35.211+09:00 level=TRACE msg=Conn.ExecContext conn_id=a585Q3ZDe7vga5RV query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" -time=2025-08-06T22:40:35.212+09:00 level=INFO msg=Conn.ExecContext conn_id=a585Q3ZDe7vga5RV query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=668417 -time=2025-08-06T22:40:35.212+09:00 level=TRACE msg=Tx.Commit conn_id=a585Q3ZDe7vga5RV tx_id=rj3Frb9Lcjoq1emJ -time=2025-08-06T22:40:35.212+09:00 level=INFO msg=Tx.Commit conn_id=a585Q3ZDe7vga5RV tx_id=rj3Frb9Lcjoq1emJ duration=371959 -time=2025-08-06T22:40:35.212+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.212+09:00 level=TRACE msg=Conn.ResetSession conn_id=a585Q3ZDe7vga5RV duration=166 -time=2025-08-06T22:40:35.212+09:00 level=TRACE msg=Conn.QueryContext conn_id=a585Q3ZDe7vga5RV query="SELECT * FROM test1" args=[] -time=2025-08-06T22:40:35.212+09:00 level=DEBUG msg=Conn.QueryContext conn_id=a585Q3ZDe7vga5RV query="SELECT * FROM test1" args=[] duration=316625 -time=2025-08-06T22:40:35.212+09:00 level=VERBOSE msg=Rows.Next conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.212+09:00 level=DEBUG msg=Rows.Next conn_id=a585Q3ZDe7vga5RV duration=4125 eof=false -time=2025-08-06T22:40:35.212+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:40:35.212+09:00 level=VERBOSE msg=Rows.Next conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.212+09:00 level=DEBUG msg=Rows.Next conn_id=a585Q3ZDe7vga5RV duration=750 eof=true -time=2025-08-06T22:40:35.212+09:00 level=VERBOSE msg=Rows.Close conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.212+09:00 level=DEBUG msg=Rows.Close conn_id=a585Q3ZDe7vga5RV duration=125 -time=2025-08-06T22:40:35.213+09:00 level=TRACE msg=Conn.Close conn_id=a585Q3ZDe7vga5RV -time=2025-08-06T22:40:35.213+09:00 level=INFO msg=Conn.Close conn_id=a585Q3ZDe7vga5RV duration=19959 +time=2025-08-06T23:24:01.733+09:00 level=TRACE msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T23:24:01.734+09:00 level=INFO msg=Open driver=postgres dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=24667 +time=2025-08-06T23:24:01.734+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:01.734+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T23:24:01.734+09:00 level=ERROR msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=755542 error="read tcp 127.0.0.1:61643->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T23:24:01.734+09:00 level=ERROR msg=Connector.Connect duration=787042 error="read tcp 127.0.0.1:61643->127.0.0.1:5432: read: connection reset by peer" +time=2025-08-06T23:24:03.736+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:24:03.736+09:00 level=TRACE msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" +time=2025-08-06T23:24:03.752+09:00 level=INFO msg=Driver.Open dsn="host=127.0.0.1 port=5432 user=root password=password dbname=app1 sslmode=disable" duration=15959208 conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.752+09:00 level=INFO msg=Connector.Connect duration=16194208 +time=2025-08-06T23:24:03.752+09:00 level=VERBOSE msg=Conn.Ping conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.753+09:00 level=TRACE msg=Conn.Ping conn_id=giWcNRXi0haxjgDO duration=839084 +time=2025-08-06T23:24:03.753+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.753+09:00 level=TRACE msg=Conn.ResetSession conn_id=giWcNRXi0haxjgDO duration=1458 +time=2025-08-06T23:24:03.753+09:00 level=TRACE msg=Conn.ExecContext conn_id=giWcNRXi0haxjgDO query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T23:24:03.758+09:00 level=INFO msg=Conn.ExecContext conn_id=giWcNRXi0haxjgDO query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=4599667 +time=2025-08-06T23:24:03.758+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.758+09:00 level=TRACE msg=Conn.ResetSession conn_id=giWcNRXi0haxjgDO duration=667 +time=2025-08-06T23:24:03.758+09:00 level=VERBOSE msg=Conn.Ping conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.759+09:00 level=TRACE msg=Conn.Ping conn_id=giWcNRXi0haxjgDO duration=958542 +time=2025-08-06T23:24:03.759+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.759+09:00 level=TRACE msg=Conn.ResetSession conn_id=giWcNRXi0haxjgDO duration=334 +time=2025-08-06T23:24:03.759+09:00 level=TRACE msg=Conn.BeginTx conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.760+09:00 level=INFO msg=Conn.BeginTx conn_id=giWcNRXi0haxjgDO duration=493125 tx_id=_0Hz9N_J4DB8AcoZ +time=2025-08-06T23:24:03.760+09:00 level=TRACE msg=Conn.ExecContext conn_id=giWcNRXi0haxjgDO query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" +time=2025-08-06T23:24:03.761+09:00 level=INFO msg=Conn.ExecContext conn_id=giWcNRXi0haxjgDO query="INSERT INTO test1 (id, name) VALUES ($1,$2);" args="[1,\"Alice\"]" duration=1293791 +time=2025-08-06T23:24:03.761+09:00 level=TRACE msg=Tx.Commit conn_id=giWcNRXi0haxjgDO tx_id=_0Hz9N_J4DB8AcoZ +time=2025-08-06T23:24:03.762+09:00 level=INFO msg=Tx.Commit conn_id=giWcNRXi0haxjgDO tx_id=_0Hz9N_J4DB8AcoZ duration=1052833 +time=2025-08-06T23:24:03.762+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.762+09:00 level=TRACE msg=Conn.ResetSession conn_id=giWcNRXi0haxjgDO duration=375 +time=2025-08-06T23:24:03.762+09:00 level=TRACE msg=Conn.QueryContext conn_id=giWcNRXi0haxjgDO query="SELECT * FROM test1" args=[] +time=2025-08-06T23:24:03.763+09:00 level=DEBUG msg=Conn.QueryContext conn_id=giWcNRXi0haxjgDO query="SELECT * FROM test1" args=[] duration=645417 +time=2025-08-06T23:24:03.763+09:00 level=VERBOSE msg=Rows.Next conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.763+09:00 level=DEBUG msg=Rows.Next conn_id=giWcNRXi0haxjgDO duration=2625 eof=false +time=2025-08-06T23:24:03.763+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:24:03.763+09:00 level=VERBOSE msg=Rows.Next conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.763+09:00 level=DEBUG msg=Rows.Next conn_id=giWcNRXi0haxjgDO duration=1584 eof=true +time=2025-08-06T23:24:03.763+09:00 level=VERBOSE msg=Rows.Close conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.763+09:00 level=DEBUG msg=Rows.Close conn_id=giWcNRXi0haxjgDO duration=292 +time=2025-08-06T23:24:03.763+09:00 level=TRACE msg=Conn.Close conn_id=giWcNRXi0haxjgDO +time=2025-08-06T23:24:03.763+09:00 level=INFO msg=Conn.Close conn_id=giWcNRXi0haxjgDO duration=70833 diff --git a/examples/logs-sqlite3/results/debug-log.txt b/examples/logs-sqlite3/results/debug-log.txt index 1acc992..504b85b 100644 --- a/examples/logs-sqlite3/results/debug-log.txt +++ b/examples/logs-sqlite3/results/debug-log.txt @@ -1,13 +1,13 @@ -time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=13875 -time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=121583 conn_id=QT2zNrs9NoJk9sin -time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Connector.Connect duration=130541 -time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Conn.ExecContext conn_id=QT2zNrs9NoJk9sin query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=37542 -time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Conn.BeginTx conn_id=QT2zNrs9NoJk9sin duration=2334 tx_id=0waYiZhjBs845sni -time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Conn.ExecContext conn_id=QT2zNrs9NoJk9sin query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=8333 -time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Tx.Commit conn_id=QT2zNrs9NoJk9sin tx_id=0waYiZhjBs845sni duration=3458 -time=2025-08-06T22:40:20.216+09:00 level=DEBUG msg=Conn.QueryContext conn_id=QT2zNrs9NoJk9sin query="SELECT * FROM test1" args=[] duration=4292 -time=2025-08-06T22:40:20.216+09:00 level=DEBUG msg=Rows.Next conn_id=QT2zNrs9NoJk9sin duration=2458 eof=false -time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:40:20.216+09:00 level=DEBUG msg=Rows.Next conn_id=QT2zNrs9NoJk9sin duration=875 eof=true -time=2025-08-06T22:40:20.216+09:00 level=DEBUG msg=Rows.Close conn_id=QT2zNrs9NoJk9sin duration=417 -time=2025-08-06T22:40:20.216+09:00 level=INFO msg=Conn.Close conn_id=QT2zNrs9NoJk9sin duration=8750 +time=2025-08-06T23:23:51.824+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=45709 +time=2025-08-06T23:23:51.825+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=546334 conn_id=BmDho0jLHtC3vspy +time=2025-08-06T23:23:51.825+09:00 level=INFO msg=Connector.Connect duration=557875 +time=2025-08-06T23:23:51.825+09:00 level=INFO msg=Conn.ExecContext conn_id=BmDho0jLHtC3vspy query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=58417 +time=2025-08-06T23:23:51.825+09:00 level=INFO msg=Conn.BeginTx conn_id=BmDho0jLHtC3vspy duration=2209 tx_id=UefG6gyYqvfm45nQ +time=2025-08-06T23:23:51.825+09:00 level=INFO msg=Conn.ExecContext conn_id=BmDho0jLHtC3vspy query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=7375 +time=2025-08-06T23:23:51.825+09:00 level=INFO msg=Tx.Commit conn_id=BmDho0jLHtC3vspy tx_id=UefG6gyYqvfm45nQ duration=3125 +time=2025-08-06T23:23:51.825+09:00 level=DEBUG msg=Conn.QueryContext conn_id=BmDho0jLHtC3vspy query="SELECT * FROM test1" args=[] duration=3958 +time=2025-08-06T23:23:51.825+09:00 level=DEBUG msg=Rows.Next conn_id=BmDho0jLHtC3vspy duration=2292 eof=false +time=2025-08-06T23:23:51.825+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:23:51.825+09:00 level=DEBUG msg=Rows.Next conn_id=BmDho0jLHtC3vspy duration=833 eof=true +time=2025-08-06T23:23:51.825+09:00 level=DEBUG msg=Rows.Close conn_id=BmDho0jLHtC3vspy duration=375 +time=2025-08-06T23:23:51.825+09:00 level=INFO msg=Conn.Close conn_id=BmDho0jLHtC3vspy duration=9208 diff --git a/examples/logs-sqlite3/results/info-log.txt b/examples/logs-sqlite3/results/info-log.txt index af8c093..c879b54 100644 --- a/examples/logs-sqlite3/results/info-log.txt +++ b/examples/logs-sqlite3/results/info-log.txt @@ -1,9 +1,9 @@ -time=2025-08-06T22:40:20.129+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=169375 -time=2025-08-06T22:40:20.131+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=2116042 conn_id=enw1znVF44WbduVy -time=2025-08-06T22:40:20.131+09:00 level=INFO msg=Connector.Connect duration=2127500 -time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Conn.ExecContext conn_id=enw1znVF44WbduVy query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=53250 -time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Conn.BeginTx conn_id=enw1znVF44WbduVy duration=2167 tx_id=MsNb4eX8x4nkFio7 -time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Conn.ExecContext conn_id=enw1znVF44WbduVy query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=5959 -time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Tx.Commit conn_id=enw1znVF44WbduVy tx_id=MsNb4eX8x4nkFio7 duration=3084 -time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:40:20.132+09:00 level=INFO msg=Conn.Close conn_id=enw1znVF44WbduVy duration=9458 +time=2025-08-06T23:23:51.530+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=121792 +time=2025-08-06T23:23:51.531+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=967542 conn_id=Zs8L4IcPUoMyNZhn +time=2025-08-06T23:23:51.531+09:00 level=INFO msg=Connector.Connect duration=1000917 +time=2025-08-06T23:23:51.531+09:00 level=INFO msg=Conn.ExecContext conn_id=Zs8L4IcPUoMyNZhn query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=105041 +time=2025-08-06T23:23:51.531+09:00 level=INFO msg=Conn.BeginTx conn_id=Zs8L4IcPUoMyNZhn duration=4750 tx_id=oAevp73_l_CDxden +time=2025-08-06T23:23:51.531+09:00 level=INFO msg=Conn.ExecContext conn_id=Zs8L4IcPUoMyNZhn query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=11667 +time=2025-08-06T23:23:51.531+09:00 level=INFO msg=Tx.Commit conn_id=Zs8L4IcPUoMyNZhn tx_id=oAevp73_l_CDxden duration=5833 +time=2025-08-06T23:23:51.532+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:23:51.532+09:00 level=INFO msg=Conn.Close conn_id=Zs8L4IcPUoMyNZhn duration=19084 diff --git a/examples/logs-sqlite3/results/trace-log.txt b/examples/logs-sqlite3/results/trace-log.txt index cbb206a..1af210f 100644 --- a/examples/logs-sqlite3/results/trace-log.txt +++ b/examples/logs-sqlite3/results/trace-log.txt @@ -1,24 +1,24 @@ -time=2025-08-06T22:40:20.295+09:00 level=TRACE msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" -time=2025-08-06T22:40:20.295+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=7333 -time=2025-08-06T22:40:20.295+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:20.295+09:00 level=TRACE msg=Driver.Open dsn="file::memory:?cache=shared" -time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=108292 conn_id=Pt8MebJ3B4VArvmW -time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Connector.Connect duration=119708 -time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.ExecContext conn_id=Pt8MebJ3B4VArvmW query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Conn.ExecContext conn_id=Pt8MebJ3B4VArvmW query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=37958 -time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.ResetSession conn_id=Pt8MebJ3B4VArvmW duration=334 -time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.BeginTx conn_id=Pt8MebJ3B4VArvmW -time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Conn.BeginTx conn_id=Pt8MebJ3B4VArvmW duration=2916 tx_id=wmHAPsfoNVDOBciw -time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.ExecContext conn_id=Pt8MebJ3B4VArvmW query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" -time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Conn.ExecContext conn_id=Pt8MebJ3B4VArvmW query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=7834 -time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Tx.Commit conn_id=Pt8MebJ3B4VArvmW tx_id=wmHAPsfoNVDOBciw -time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Tx.Commit conn_id=Pt8MebJ3B4VArvmW tx_id=wmHAPsfoNVDOBciw duration=3167 -time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.ResetSession conn_id=Pt8MebJ3B4VArvmW duration=42 -time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.QueryContext conn_id=Pt8MebJ3B4VArvmW query="SELECT * FROM test1" args=[] -time=2025-08-06T22:40:20.296+09:00 level=DEBUG msg=Conn.QueryContext conn_id=Pt8MebJ3B4VArvmW query="SELECT * FROM test1" args=[] duration=4542 -time=2025-08-06T22:40:20.296+09:00 level=DEBUG msg=Rows.Next conn_id=Pt8MebJ3B4VArvmW duration=2750 eof=false -time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:40:20.296+09:00 level=DEBUG msg=Rows.Next conn_id=Pt8MebJ3B4VArvmW duration=875 eof=true -time=2025-08-06T22:40:20.296+09:00 level=DEBUG msg=Rows.Close conn_id=Pt8MebJ3B4VArvmW duration=541 -time=2025-08-06T22:40:20.296+09:00 level=TRACE msg=Conn.Close conn_id=Pt8MebJ3B4VArvmW -time=2025-08-06T22:40:20.296+09:00 level=INFO msg=Conn.Close conn_id=Pt8MebJ3B4VArvmW duration=9708 +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" +time=2025-08-06T23:23:51.944+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=9916 +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Driver.Open dsn="file::memory:?cache=shared" +time=2025-08-06T23:23:51.944+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=191083 conn_id=jAG1uDtyIgttUGsW +time=2025-08-06T23:23:51.944+09:00 level=INFO msg=Connector.Connect duration=202875 +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Conn.ExecContext conn_id=jAG1uDtyIgttUGsW query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T23:23:51.944+09:00 level=INFO msg=Conn.ExecContext conn_id=jAG1uDtyIgttUGsW query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=41125 +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Conn.ResetSession conn_id=jAG1uDtyIgttUGsW duration=291 +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Conn.BeginTx conn_id=jAG1uDtyIgttUGsW +time=2025-08-06T23:23:51.944+09:00 level=INFO msg=Conn.BeginTx conn_id=jAG1uDtyIgttUGsW duration=2625 tx_id=OQCmMz6s2uwwxiV0 +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Conn.ExecContext conn_id=jAG1uDtyIgttUGsW query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" +time=2025-08-06T23:23:51.944+09:00 level=INFO msg=Conn.ExecContext conn_id=jAG1uDtyIgttUGsW query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=8542 +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Tx.Commit conn_id=jAG1uDtyIgttUGsW tx_id=OQCmMz6s2uwwxiV0 +time=2025-08-06T23:23:51.944+09:00 level=INFO msg=Tx.Commit conn_id=jAG1uDtyIgttUGsW tx_id=OQCmMz6s2uwwxiV0 duration=3125 +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Conn.ResetSession conn_id=jAG1uDtyIgttUGsW duration=0 +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Conn.QueryContext conn_id=jAG1uDtyIgttUGsW query="SELECT * FROM test1" args=[] +time=2025-08-06T23:23:51.944+09:00 level=DEBUG msg=Conn.QueryContext conn_id=jAG1uDtyIgttUGsW query="SELECT * FROM test1" args=[] duration=4375 +time=2025-08-06T23:23:51.944+09:00 level=DEBUG msg=Rows.Next conn_id=jAG1uDtyIgttUGsW duration=2708 eof=false +time=2025-08-06T23:23:51.944+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:23:51.944+09:00 level=DEBUG msg=Rows.Next conn_id=jAG1uDtyIgttUGsW duration=625 eof=true +time=2025-08-06T23:23:51.944+09:00 level=DEBUG msg=Rows.Close conn_id=jAG1uDtyIgttUGsW duration=375 +time=2025-08-06T23:23:51.944+09:00 level=TRACE msg=Conn.Close conn_id=jAG1uDtyIgttUGsW +time=2025-08-06T23:23:51.944+09:00 level=INFO msg=Conn.Close conn_id=jAG1uDtyIgttUGsW duration=9458 diff --git a/examples/logs-sqlite3/results/verbose-log.json b/examples/logs-sqlite3/results/verbose-log.json index eecfe44..43a824b 100644 --- a/examples/logs-sqlite3/results/verbose-log.json +++ b/examples/logs-sqlite3/results/verbose-log.json @@ -1,29 +1,29 @@ -{"time":"2025-08-06T22:40:20.456795+09:00","level":"TRACE","msg":"Open","driver":"sqlite3","dsn":"file::memory:?cache=shared"} -{"time":"2025-08-06T22:40:20.45689+09:00","level":"INFO","msg":"Open","driver":"sqlite3","dsn":"file::memory:?cache=shared","duration":8125} -{"time":"2025-08-06T22:40:20.456898+09:00","level":"TRACE","msg":"Connector.Connect"} -{"time":"2025-08-06T22:40:20.456904+09:00","level":"TRACE","msg":"Driver.Open","dsn":"file::memory:?cache=shared"} -{"time":"2025-08-06T22:40:20.45704+09:00","level":"INFO","msg":"Driver.Open","dsn":"file::memory:?cache=shared","duration":130334,"conn_id":"qgXLkGeBcPcKL2bU"} -{"time":"2025-08-06T22:40:20.457045+09:00","level":"INFO","msg":"Connector.Connect","duration":143500} -{"time":"2025-08-06T22:40:20.457052+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"qgXLkGeBcPcKL2bU","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]"} -{"time":"2025-08-06T22:40:20.457094+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"qgXLkGeBcPcKL2bU","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":38084} -{"time":"2025-08-06T22:40:20.4571+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qgXLkGeBcPcKL2bU"} -{"time":"2025-08-06T22:40:20.457103+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qgXLkGeBcPcKL2bU","duration":333} -{"time":"2025-08-06T22:40:20.457105+09:00","level":"TRACE","msg":"Conn.BeginTx","conn_id":"qgXLkGeBcPcKL2bU"} -{"time":"2025-08-06T22:40:20.45711+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"qgXLkGeBcPcKL2bU","duration":2500,"tx_id":"8AGn9638GIFYlkD9"} -{"time":"2025-08-06T22:40:20.457118+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"qgXLkGeBcPcKL2bU","query":"INSERT INTO test1 (name) VALUES (?)","args":"[\"Alice\"]"} -{"time":"2025-08-06T22:40:20.45713+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"qgXLkGeBcPcKL2bU","query":"INSERT INTO test1 (name) VALUES (?)","args":"[\"Alice\"]","duration":8000} -{"time":"2025-08-06T22:40:20.457136+09:00","level":"TRACE","msg":"Tx.Commit","conn_id":"qgXLkGeBcPcKL2bU","tx_id":"8AGn9638GIFYlkD9"} -{"time":"2025-08-06T22:40:20.457143+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"qgXLkGeBcPcKL2bU","tx_id":"8AGn9638GIFYlkD9","duration":3375} -{"time":"2025-08-06T22:40:20.457146+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"qgXLkGeBcPcKL2bU"} -{"time":"2025-08-06T22:40:20.457148+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"qgXLkGeBcPcKL2bU","duration":41} -{"time":"2025-08-06T22:40:20.457151+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"qgXLkGeBcPcKL2bU","query":"SELECT * FROM test1","args":"[]"} -{"time":"2025-08-06T22:40:20.457158+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"qgXLkGeBcPcKL2bU","query":"SELECT * FROM test1","args":"[]","duration":4375} -{"time":"2025-08-06T22:40:20.457162+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"qgXLkGeBcPcKL2bU"} -{"time":"2025-08-06T22:40:20.45717+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"qgXLkGeBcPcKL2bU","duration":2583,"eof":false} -{"time":"2025-08-06T22:40:20.457176+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} -{"time":"2025-08-06T22:40:20.457179+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"qgXLkGeBcPcKL2bU"} -{"time":"2025-08-06T22:40:20.457182+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"qgXLkGeBcPcKL2bU","duration":833,"eof":true} -{"time":"2025-08-06T22:40:20.457185+09:00","level":"VERBOSE","msg":"Rows.Close","conn_id":"qgXLkGeBcPcKL2bU"} -{"time":"2025-08-06T22:40:20.457187+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"qgXLkGeBcPcKL2bU","duration":500} -{"time":"2025-08-06T22:40:20.457191+09:00","level":"TRACE","msg":"Conn.Close","conn_id":"qgXLkGeBcPcKL2bU"} -{"time":"2025-08-06T22:40:20.457203+09:00","level":"INFO","msg":"Conn.Close","conn_id":"qgXLkGeBcPcKL2bU","duration":9333} +{"time":"2025-08-06T23:23:52.116283+09:00","level":"TRACE","msg":"Open","driver":"sqlite3","dsn":"file::memory:?cache=shared"} +{"time":"2025-08-06T23:23:52.116387+09:00","level":"INFO","msg":"Open","driver":"sqlite3","dsn":"file::memory:?cache=shared","duration":9500} +{"time":"2025-08-06T23:23:52.116395+09:00","level":"TRACE","msg":"Connector.Connect"} +{"time":"2025-08-06T23:23:52.116399+09:00","level":"TRACE","msg":"Driver.Open","dsn":"file::memory:?cache=shared"} +{"time":"2025-08-06T23:23:52.116534+09:00","level":"INFO","msg":"Driver.Open","dsn":"file::memory:?cache=shared","duration":130542,"conn_id":"SJ9moTag3YK8MQLF"} +{"time":"2025-08-06T23:23:52.116544+09:00","level":"INFO","msg":"Connector.Connect","duration":144625} +{"time":"2025-08-06T23:23:52.11655+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"SJ9moTag3YK8MQLF","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]"} +{"time":"2025-08-06T23:23:52.116595+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"SJ9moTag3YK8MQLF","query":"CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))","args":"[]","duration":40292} +{"time":"2025-08-06T23:23:52.1166+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"SJ9moTag3YK8MQLF"} +{"time":"2025-08-06T23:23:52.116603+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"SJ9moTag3YK8MQLF","duration":334} +{"time":"2025-08-06T23:23:52.116606+09:00","level":"TRACE","msg":"Conn.BeginTx","conn_id":"SJ9moTag3YK8MQLF"} +{"time":"2025-08-06T23:23:52.116614+09:00","level":"INFO","msg":"Conn.BeginTx","conn_id":"SJ9moTag3YK8MQLF","duration":5625,"tx_id":"eDDVDXHsbgT0oPqc"} +{"time":"2025-08-06T23:23:52.116624+09:00","level":"TRACE","msg":"Conn.ExecContext","conn_id":"SJ9moTag3YK8MQLF","query":"INSERT INTO test1 (name) VALUES (?)","args":"[\"Alice\"]"} +{"time":"2025-08-06T23:23:52.116639+09:00","level":"INFO","msg":"Conn.ExecContext","conn_id":"SJ9moTag3YK8MQLF","query":"INSERT INTO test1 (name) VALUES (?)","args":"[\"Alice\"]","duration":8958} +{"time":"2025-08-06T23:23:52.116646+09:00","level":"TRACE","msg":"Tx.Commit","conn_id":"SJ9moTag3YK8MQLF","tx_id":"eDDVDXHsbgT0oPqc"} +{"time":"2025-08-06T23:23:52.116651+09:00","level":"INFO","msg":"Tx.Commit","conn_id":"SJ9moTag3YK8MQLF","tx_id":"eDDVDXHsbgT0oPqc","duration":3167} +{"time":"2025-08-06T23:23:52.116655+09:00","level":"VERBOSE","msg":"Conn.ResetSession","conn_id":"SJ9moTag3YK8MQLF"} +{"time":"2025-08-06T23:23:52.116657+09:00","level":"TRACE","msg":"Conn.ResetSession","conn_id":"SJ9moTag3YK8MQLF","duration":0} +{"time":"2025-08-06T23:23:52.11666+09:00","level":"TRACE","msg":"Conn.QueryContext","conn_id":"SJ9moTag3YK8MQLF","query":"SELECT * FROM test1","args":"[]"} +{"time":"2025-08-06T23:23:52.116667+09:00","level":"DEBUG","msg":"Conn.QueryContext","conn_id":"SJ9moTag3YK8MQLF","query":"SELECT * FROM test1","args":"[]","duration":4292} +{"time":"2025-08-06T23:23:52.116672+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"SJ9moTag3YK8MQLF"} +{"time":"2025-08-06T23:23:52.116678+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"SJ9moTag3YK8MQLF","duration":2833,"eof":false} +{"time":"2025-08-06T23:23:52.116686+09:00","level":"INFO","msg":"Record","id":1,"name":"Alice"} +{"time":"2025-08-06T23:23:52.116688+09:00","level":"VERBOSE","msg":"Rows.Next","conn_id":"SJ9moTag3YK8MQLF"} +{"time":"2025-08-06T23:23:52.116692+09:00","level":"DEBUG","msg":"Rows.Next","conn_id":"SJ9moTag3YK8MQLF","duration":916,"eof":true} +{"time":"2025-08-06T23:23:52.116695+09:00","level":"VERBOSE","msg":"Rows.Close","conn_id":"SJ9moTag3YK8MQLF"} +{"time":"2025-08-06T23:23:52.116698+09:00","level":"DEBUG","msg":"Rows.Close","conn_id":"SJ9moTag3YK8MQLF","duration":458} +{"time":"2025-08-06T23:23:52.116702+09:00","level":"TRACE","msg":"Conn.Close","conn_id":"SJ9moTag3YK8MQLF"} +{"time":"2025-08-06T23:23:52.116715+09:00","level":"INFO","msg":"Conn.Close","conn_id":"SJ9moTag3YK8MQLF","duration":10333} diff --git a/examples/logs-sqlite3/results/verbose-log.txt b/examples/logs-sqlite3/results/verbose-log.txt index c2f7892..1caf2ad 100644 --- a/examples/logs-sqlite3/results/verbose-log.txt +++ b/examples/logs-sqlite3/results/verbose-log.txt @@ -1,29 +1,29 @@ -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" -time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=7917 -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Connector.Connect -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Driver.Open dsn="file::memory:?cache=shared" -time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=110250 conn_id=CC5HhmOHgOuaxnyw -time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Connector.Connect duration=122333 -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.ExecContext conn_id=CC5HhmOHgOuaxnyw query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] -time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Conn.ExecContext conn_id=CC5HhmOHgOuaxnyw query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=37625 -time=2025-08-06T22:40:20.376+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=CC5HhmOHgOuaxnyw -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.ResetSession conn_id=CC5HhmOHgOuaxnyw duration=333 -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.BeginTx conn_id=CC5HhmOHgOuaxnyw -time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Conn.BeginTx conn_id=CC5HhmOHgOuaxnyw duration=2458 tx_id=YkPxtXFLyvViW1Cs -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.ExecContext conn_id=CC5HhmOHgOuaxnyw query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" -time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Conn.ExecContext conn_id=CC5HhmOHgOuaxnyw query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=8083 -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Tx.Commit conn_id=CC5HhmOHgOuaxnyw tx_id=YkPxtXFLyvViW1Cs -time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Tx.Commit conn_id=CC5HhmOHgOuaxnyw tx_id=YkPxtXFLyvViW1Cs duration=3208 -time=2025-08-06T22:40:20.376+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=CC5HhmOHgOuaxnyw -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.ResetSession conn_id=CC5HhmOHgOuaxnyw duration=42 -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.QueryContext conn_id=CC5HhmOHgOuaxnyw query="SELECT * FROM test1" args=[] -time=2025-08-06T22:40:20.376+09:00 level=DEBUG msg=Conn.QueryContext conn_id=CC5HhmOHgOuaxnyw query="SELECT * FROM test1" args=[] duration=4291 -time=2025-08-06T22:40:20.376+09:00 level=VERBOSE msg=Rows.Next conn_id=CC5HhmOHgOuaxnyw -time=2025-08-06T22:40:20.376+09:00 level=DEBUG msg=Rows.Next conn_id=CC5HhmOHgOuaxnyw duration=2500 eof=false -time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Record id=1 name=Alice -time=2025-08-06T22:40:20.376+09:00 level=VERBOSE msg=Rows.Next conn_id=CC5HhmOHgOuaxnyw -time=2025-08-06T22:40:20.376+09:00 level=DEBUG msg=Rows.Next conn_id=CC5HhmOHgOuaxnyw duration=834 eof=true -time=2025-08-06T22:40:20.376+09:00 level=VERBOSE msg=Rows.Close conn_id=CC5HhmOHgOuaxnyw -time=2025-08-06T22:40:20.376+09:00 level=DEBUG msg=Rows.Close conn_id=CC5HhmOHgOuaxnyw duration=416 -time=2025-08-06T22:40:20.376+09:00 level=TRACE msg=Conn.Close conn_id=CC5HhmOHgOuaxnyw -time=2025-08-06T22:40:20.376+09:00 level=INFO msg=Conn.Close conn_id=CC5HhmOHgOuaxnyw duration=9375 +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" +time=2025-08-06T23:23:52.030+09:00 level=INFO msg=Open driver=sqlite3 dsn="file::memory:?cache=shared" duration=7334 +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Connector.Connect +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Driver.Open dsn="file::memory:?cache=shared" +time=2025-08-06T23:23:52.030+09:00 level=INFO msg=Driver.Open dsn="file::memory:?cache=shared" duration=132458 conn_id=h_puYkHhQqD5H2eY +time=2025-08-06T23:23:52.030+09:00 level=INFO msg=Connector.Connect duration=145083 +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Conn.ExecContext conn_id=h_puYkHhQqD5H2eY query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] +time=2025-08-06T23:23:52.030+09:00 level=INFO msg=Conn.ExecContext conn_id=h_puYkHhQqD5H2eY query="CREATE TABLE IF NOT EXISTS test1 (id INTEGER PRIMARY KEY, name VARCHAR(255))" args=[] duration=45750 +time=2025-08-06T23:23:52.030+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=h_puYkHhQqD5H2eY +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Conn.ResetSession conn_id=h_puYkHhQqD5H2eY duration=375 +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Conn.BeginTx conn_id=h_puYkHhQqD5H2eY +time=2025-08-06T23:23:52.030+09:00 level=INFO msg=Conn.BeginTx conn_id=h_puYkHhQqD5H2eY duration=2583 tx_id=CmO0XjmAvjYSuYLy +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Conn.ExecContext conn_id=h_puYkHhQqD5H2eY query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" +time=2025-08-06T23:23:52.030+09:00 level=INFO msg=Conn.ExecContext conn_id=h_puYkHhQqD5H2eY query="INSERT INTO test1 (name) VALUES (?)" args="[\"Alice\"]" duration=7459 +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Tx.Commit conn_id=h_puYkHhQqD5H2eY tx_id=CmO0XjmAvjYSuYLy +time=2025-08-06T23:23:52.030+09:00 level=INFO msg=Tx.Commit conn_id=h_puYkHhQqD5H2eY tx_id=CmO0XjmAvjYSuYLy duration=2709 +time=2025-08-06T23:23:52.030+09:00 level=VERBOSE msg=Conn.ResetSession conn_id=h_puYkHhQqD5H2eY +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Conn.ResetSession conn_id=h_puYkHhQqD5H2eY duration=42 +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Conn.QueryContext conn_id=h_puYkHhQqD5H2eY query="SELECT * FROM test1" args=[] +time=2025-08-06T23:23:52.030+09:00 level=DEBUG msg=Conn.QueryContext conn_id=h_puYkHhQqD5H2eY query="SELECT * FROM test1" args=[] duration=4084 +time=2025-08-06T23:23:52.030+09:00 level=VERBOSE msg=Rows.Next conn_id=h_puYkHhQqD5H2eY +time=2025-08-06T23:23:52.030+09:00 level=DEBUG msg=Rows.Next conn_id=h_puYkHhQqD5H2eY duration=2583 eof=false +time=2025-08-06T23:23:52.030+09:00 level=INFO msg=Record id=1 name=Alice +time=2025-08-06T23:23:52.030+09:00 level=VERBOSE msg=Rows.Next conn_id=h_puYkHhQqD5H2eY +time=2025-08-06T23:23:52.030+09:00 level=DEBUG msg=Rows.Next conn_id=h_puYkHhQqD5H2eY duration=750 eof=true +time=2025-08-06T23:23:52.030+09:00 level=VERBOSE msg=Rows.Close conn_id=h_puYkHhQqD5H2eY +time=2025-08-06T23:23:52.030+09:00 level=DEBUG msg=Rows.Close conn_id=h_puYkHhQqD5H2eY duration=375 +time=2025-08-06T23:23:52.030+09:00 level=TRACE msg=Conn.Close conn_id=h_puYkHhQqD5H2eY +time=2025-08-06T23:23:52.030+09:00 level=INFO msg=Conn.Close conn_id=h_puYkHhQqD5H2eY duration=9416 From c1999e8da8d486cc8bd956b8b6c3a85b5a51749e Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 23:37:33 +0900 Subject: [PATCH 09/11] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Extract=20functions?= =?UTF-8?q?=20from=20formatNamedValues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stmt_args.go | 56 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/stmt_args.go b/stmt_args.go index c4550b2..29ff2ec 100644 --- a/stmt_args.go +++ b/stmt_args.go @@ -16,33 +16,45 @@ func formatNamedValues(args []driver.NamedValue) string { return "[]" } if !slices.ContainsFunc(args, func(arg driver.NamedValue) bool { return arg.Name == "" }) { - var b strings.Builder - b.WriteString("{") - for i, arg := range args { - if i > 0 { - b.WriteString(",") - } - fmt.Fprintf(&b, "%s:", arg.Name) - b.WriteString(formatValue(arg.Value)) - } - b.WriteString("}") - return b.String() + return formatNamedValuesWithNames(args) } if !slices.ContainsFunc(args, func(arg driver.NamedValue) bool { return arg.Name != "" }) { - if !slices.IsSortedFunc(args, cmpNamedValueByOrdinal) { - slices.SortFunc(args, cmpNamedValueByOrdinal) + return formatNamedValuesWithoutNames(args) + } + return formatNamedValuesWithMixedNames(args) +} + +func formatNamedValuesWithNames(args []driver.NamedValue) string { + var b strings.Builder + b.WriteString("{") + for i, arg := range args { + if i > 0 { + b.WriteString(",") } - var b strings.Builder - b.WriteString("[") - for i, arg := range args { - if i > 0 { - b.WriteString(",") - } - b.WriteString(formatValue(arg.Value)) + fmt.Fprintf(&b, "%s:", arg.Name) + b.WriteString(formatValue(arg.Value)) + } + b.WriteString("}") + return b.String() +} + +func formatNamedValuesWithoutNames(args []driver.NamedValue) string { + if !slices.IsSortedFunc(args, cmpNamedValueByOrdinal) { + slices.SortFunc(args, cmpNamedValueByOrdinal) + } + var b strings.Builder + b.WriteString("[") + for i, arg := range args { + if i > 0 { + b.WriteString(",") } - b.WriteString("]") - return b.String() + b.WriteString(formatValue(arg.Value)) } + b.WriteString("]") + return b.String() +} + +func formatNamedValuesWithMixedNames(args []driver.NamedValue) string { var b strings.Builder b.WriteString("[") for i, arg := range args { From b31ca9989e6bcc2a067e9bcfe904151bc6f527af Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 23:39:04 +0900 Subject: [PATCH 10/11] =?UTF-8?q?=E2=9C=85=20Use=20t.Parallel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stmt_args_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/stmt_args_test.go b/stmt_args_test.go index 27558ec..442b2b6 100644 --- a/stmt_args_test.go +++ b/stmt_args_test.go @@ -52,6 +52,7 @@ func TestFormatNamedValues(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() got := formatNamedValues(tt.args) if got != tt.want { t.Errorf("formatNamedValues() = %v, want %v", got, tt.want) From b9b5d9c1859c39ec7e94cfcfc0000f9393fb0142 Mon Sep 17 00:00:00 2001 From: akm Date: Wed, 6 Aug 2025 23:48:37 +0900 Subject: [PATCH 11/11] =?UTF-8?q?=E2=9C=85=20Add=20tests=20for=20formatVal?= =?UTF-8?q?ue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stmt_args_test.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/stmt_args_test.go b/stmt_args_test.go index 442b2b6..21de6d1 100644 --- a/stmt_args_test.go +++ b/stmt_args_test.go @@ -3,6 +3,7 @@ package sqlslog import ( "database/sql/driver" "testing" + "time" ) func TestFormatNamedValues(t *testing.T) { @@ -60,3 +61,34 @@ func TestFormatNamedValues(t *testing.T) { }) } } + +func TestFormatValue(t *testing.T) { + t.Parallel() + + tests := []struct { + value driver.Value + want string + }{ + {value: nil, want: ""}, + {value: true, want: "true"}, + {value: false, want: "false"}, + {value: 123, want: "123"}, + {value: 1.23, want: "1.23"}, + {value: "test", want: "\"test\""}, + {value: []byte("bytes"), want: "\"bytes\""}, + {value: []int{1, 2, 3}, want: "[1 2 3]"}, + {value: map[string]int{"a": 1, "b": 2}, want: "map[a:1 b:2]"}, + {value: struct{ A int }{A: 1}, want: "{1}"}, + {value: time.Date(2023, 10, 1, 12, 0, 0, 0, time.UTC), want: "2023-10-01 12:00:00 +0000 UTC"}, + } + + for _, tt := range tests { + t.Run(tt.want, func(t *testing.T) { + t.Parallel() + got := formatValue(tt.value) + if got != tt.want { + t.Errorf("formatValue(%v) = %v, want %v", tt.value, got, tt.want) + } + }) + } +}