Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go/vt/vtgate/logstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ func (stats *LogStats) Format(params url.Values) string {
username,
stats.ImmediateCaller(),
stats.EffectiveCaller(),
stats.StartTime.Format(time.StampMicro),
stats.EndTime.Format(time.StampMicro),
stats.StartTime.Format("2006-01-02 15:04:05.000000"),
stats.EndTime.Format("2006-01-02 15:04:05.000000"),
stats.TotalTime().Seconds(),
stats.PlanTime.Seconds(),
stats.ExecuteTime.Seconds(),
Expand Down
14 changes: 7 additions & 7 deletions go/vt/vtgate/logstats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ import (
func TestLogStatsFormat(t *testing.T) {
logStats := NewLogStats(context.Background(), "test", "sql1", map[string]*querypb.BindVariable{"intVal": sqltypes.Int64BindVariable(1)})
logStats.StartTime = time.Date(2017, time.January, 1, 1, 2, 3, 0, time.UTC)
logStats.EndTime = time.Date(2017, time.January, 1, 1, 2, 4, 0, time.UTC)
logStats.EndTime = time.Date(2017, time.January, 1, 1, 2, 4, 1234, time.UTC)
params := map[string][]string{"full": {}}

*streamlog.RedactDebugUIQueries = false
*streamlog.QueryLogFormat = "text"
got := logStats.Format(url.Values(params))
want := "test\t\t\t''\t''\tJan 1 01:02:03.000000\tJan 1 01:02:04.000000\t1.000000\t0.000000\t0.000000\t0.000000\t\t\"sql1\"\tmap[intVal:type:INT64 value:\"1\" ]\t0\t0\t\"\"\t\n"
want := "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1\"\tmap[intVal:type:INT64 value:\"1\" ]\t0\t0\t\"\"\t\n"
if got != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%q\n", got, want)
}

*streamlog.RedactDebugUIQueries = true
*streamlog.QueryLogFormat = "text"
got = logStats.Format(url.Values(params))
want = "test\t\t\t''\t''\tJan 1 01:02:03.000000\tJan 1 01:02:04.000000\t1.000000\t0.000000\t0.000000\t0.000000\t\t\"sql1\"\t\"[REDACTED]\"\t0\t0\t\"\"\t\n"
want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1\"\t\"[REDACTED]\"\t0\t0\t\"\"\t\n"
if got != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%q\n", got, want)
}
Expand All @@ -67,7 +67,7 @@ func TestLogStatsFormat(t *testing.T) {
if err != nil {
t.Errorf("logstats format: error marshaling json: %v -- got:\n%v", err, got)
}
want = "{\n \"BindVars\": {\n \"intVal\": {\n \"type\": \"INT64\",\n \"value\": 1\n }\n },\n \"CommitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"Jan 1 01:02:04.000000\",\n \"Error\": \"\",\n \"ExecuteTime\": 0,\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"PlanTime\": 0,\n \"RemoteAddr\": \"\",\n \"RowsAffected\": 0,\n \"SQL\": \"sql1\",\n \"ShardQueries\": 0,\n \"Start\": \"Jan 1 01:02:03.000000\",\n \"StmtType\": \"\",\n \"TotalTime\": 1,\n \"Username\": \"\"\n}"
want = "{\n \"BindVars\": {\n \"intVal\": {\n \"type\": \"INT64\",\n \"value\": 1\n }\n },\n \"CommitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"2017-01-01 01:02:04.000001\",\n \"Error\": \"\",\n \"ExecuteTime\": 0,\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"PlanTime\": 0,\n \"RemoteAddr\": \"\",\n \"RowsAffected\": 0,\n \"SQL\": \"sql1\",\n \"ShardQueries\": 0,\n \"Start\": \"2017-01-01 01:02:03.000000\",\n \"StmtType\": \"\",\n \"TotalTime\": 1.000001,\n \"Username\": \"\"\n}"
if string(formatted) != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%v\n", string(formatted), want)
}
Expand All @@ -83,7 +83,7 @@ func TestLogStatsFormat(t *testing.T) {
if err != nil {
t.Errorf("logstats format: error marshaling json: %v -- got:\n%v", err, got)
}
want = "{\n \"BindVars\": \"[REDACTED]\",\n \"CommitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"Jan 1 01:02:04.000000\",\n \"Error\": \"\",\n \"ExecuteTime\": 0,\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"PlanTime\": 0,\n \"RemoteAddr\": \"\",\n \"RowsAffected\": 0,\n \"SQL\": \"sql1\",\n \"ShardQueries\": 0,\n \"Start\": \"Jan 1 01:02:03.000000\",\n \"StmtType\": \"\",\n \"TotalTime\": 1,\n \"Username\": \"\"\n}"
want = "{\n \"BindVars\": \"[REDACTED]\",\n \"CommitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"2017-01-01 01:02:04.000001\",\n \"Error\": \"\",\n \"ExecuteTime\": 0,\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"PlanTime\": 0,\n \"RemoteAddr\": \"\",\n \"RowsAffected\": 0,\n \"SQL\": \"sql1\",\n \"ShardQueries\": 0,\n \"Start\": \"2017-01-01 01:02:03.000000\",\n \"StmtType\": \"\",\n \"TotalTime\": 1.000001,\n \"Username\": \"\"\n}"
if string(formatted) != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%v\n", string(formatted), want)
}
Expand All @@ -96,7 +96,7 @@ func TestLogStatsFormat(t *testing.T) {

*streamlog.QueryLogFormat = "text"
got = logStats.Format(url.Values(params))
want = "test\t\t\t''\t''\tJan 1 01:02:03.000000\tJan 1 01:02:04.000000\t1.000000\t0.000000\t0.000000\t0.000000\t\t\"sql1\"\tmap[strVal:type:VARCHAR value:\"abc\" ]\t0\t0\t\"\"\t\n"
want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1\"\tmap[strVal:type:VARCHAR value:\"abc\" ]\t0\t0\t\"\"\t\n"
if got != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%q\n", got, want)
}
Expand All @@ -111,7 +111,7 @@ func TestLogStatsFormat(t *testing.T) {
if err != nil {
t.Errorf("logstats format: error marshaling json: %v -- got:\n%v", err, got)
}
want = "{\n \"BindVars\": {\n \"strVal\": {\n \"type\": \"VARCHAR\",\n \"value\": \"abc\"\n }\n },\n \"CommitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"Jan 1 01:02:04.000000\",\n \"Error\": \"\",\n \"ExecuteTime\": 0,\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"PlanTime\": 0,\n \"RemoteAddr\": \"\",\n \"RowsAffected\": 0,\n \"SQL\": \"sql1\",\n \"ShardQueries\": 0,\n \"Start\": \"Jan 1 01:02:03.000000\",\n \"StmtType\": \"\",\n \"TotalTime\": 1,\n \"Username\": \"\"\n}"
want = "{\n \"BindVars\": {\n \"strVal\": {\n \"type\": \"VARCHAR\",\n \"value\": \"abc\"\n }\n },\n \"CommitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"2017-01-01 01:02:04.000001\",\n \"Error\": \"\",\n \"ExecuteTime\": 0,\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"PlanTime\": 0,\n \"RemoteAddr\": \"\",\n \"RowsAffected\": 0,\n \"SQL\": \"sql1\",\n \"ShardQueries\": 0,\n \"Start\": \"2017-01-01 01:02:03.000000\",\n \"StmtType\": \"\",\n \"TotalTime\": 1.000001,\n \"Username\": \"\"\n}"
if string(formatted) != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%v\n", string(formatted), want)
}
Expand Down
4 changes: 2 additions & 2 deletions go/vt/vttablet/filelogger/filelogger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestFileLog(t *testing.T) {
// Allow time for propagation
time.Sleep(10 * time.Millisecond)

want := "\t\t\t''\t''\tJan 1 00:00:00.000000\tJan 1 00:00:00.000000\t0.000000\t\t\"test 1\"\tmap[]\t1\t\"test 1 PII\"\tmysql\t0.000000\t0.000000\t0\t0\t\"\"\t\n\t\t\t''\t''\tJan 1 00:00:00.000000\tJan 1 00:00:00.000000\t0.000000\t\t\"test 2\"\tmap[]\t1\t\"test 2 PII\"\tmysql\t0.000000\t0.000000\t0\t0\t\"\"\t\n"
want := "\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\t\t\"test 1\"\tmap[]\t1\t\"test 1 PII\"\tmysql\t0.000000\t0.000000\t0\t0\t\"\"\t\n\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\t\t\"test 2\"\tmap[]\t1\t\"test 2 PII\"\tmysql\t0.000000\t0.000000\t0\t0\t\"\"\t\n"
contents, _ := ioutil.ReadFile(logPath)
got := string(contents)
if want != string(got) {
Expand Down Expand Up @@ -110,7 +110,7 @@ func TestFileLogRedacted(t *testing.T) {
// Allow time for propagation
time.Sleep(10 * time.Millisecond)

want := "\t\t\t''\t''\tJan 1 00:00:00.000000\tJan 1 00:00:00.000000\t0.000000\t\t\"test 1\"\t\"[REDACTED]\"\t1\t\"[REDACTED]\"\tmysql\t0.000000\t0.000000\t0\t0\t\"\"\t\n\t\t\t''\t''\tJan 1 00:00:00.000000\tJan 1 00:00:00.000000\t0.000000\t\t\"test 2\"\t\"[REDACTED]\"\t1\t\"[REDACTED]\"\tmysql\t0.000000\t0.000000\t0\t0\t\"\"\t\n"
want := "\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\t\t\"test 1\"\t\"[REDACTED]\"\t1\t\"[REDACTED]\"\tmysql\t0.000000\t0.000000\t0\t0\t\"\"\t\n\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\t\t\"test 2\"\t\"[REDACTED]\"\t1\t\"[REDACTED]\"\tmysql\t0.000000\t0.000000\t0\t0\t\"\"\t\n"
contents, _ := ioutil.ReadFile(logPath)
got := string(contents)
if want != string(got) {
Expand Down
4 changes: 2 additions & 2 deletions go/vt/vttablet/sysloglogger/sysloglogger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ func (fw *failingFakeWriter) Close() error { return nil }

// expectedLogStatsText returns the results expected from the plugin processing a dummy message generated by mockLogStats(...).
func expectedLogStatsText(originalSQL string) string {
return fmt.Sprintf("Execute\t\t\t''\t''\tJan 1 00:00:00.000000\tJan 1 00:00:00.000000\t0.000000\tPASS_SELECT\t"+
return fmt.Sprintf("Execute\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\tPASS_SELECT\t"+
"\"%s\"\t%s\t1\t\"%s\"\tmysql\t0.000000\t0.000000\t0\t0\t\"\"", originalSQL, "map[]", originalSQL)
}

// expectedRedactedLogStatsText returns the results expected from the plugin processing a dummy message generated by mockLogStats(...)
// when redaction is enabled.
func expectedRedactedLogStatsText(originalSQL string) string {
return fmt.Sprintf("Execute\t\t\t''\t''\tJan 1 00:00:00.000000\tJan 1 00:00:00.000000\t0.000000\tPASS_SELECT\t"+
return fmt.Sprintf("Execute\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\tPASS_SELECT\t"+
"\"%s\"\t%q\t1\t\"%s\"\tmysql\t0.000000\t0.000000\t0\t0\t\"\"", originalSQL, "[REDACTED]", "[REDACTED]")
}

Expand Down
4 changes: 2 additions & 2 deletions go/vt/vttablet/tabletserver/tabletenv/logstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ func (stats *LogStats) Format(params url.Values) string {
username,
stats.ImmediateCaller(),
stats.EffectiveCaller(),
stats.StartTime.Format(time.StampMicro),
stats.EndTime.Format(time.StampMicro),
stats.StartTime.Format("2006-01-02 15:04:05.000000"),
stats.EndTime.Format("2006-01-02 15:04:05.000000"),
stats.TotalTime().Seconds(),
stats.PlanType,
stats.OriginalSQL,
Expand Down
14 changes: 7 additions & 7 deletions go/vt/vttablet/tabletserver/tabletenv/logstats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestLogStats(t *testing.T) {
func TestLogStatsFormat(t *testing.T) {
logStats := NewLogStats(context.Background(), "test")
logStats.StartTime = time.Date(2017, time.January, 1, 1, 2, 3, 0, time.UTC)
logStats.EndTime = time.Date(2017, time.January, 1, 1, 2, 4, 0, time.UTC)
logStats.EndTime = time.Date(2017, time.January, 1, 1, 2, 4, 1234, time.UTC)
logStats.OriginalSQL = "sql"
logStats.BindVariables = map[string]*querypb.BindVariable{"intVal": sqltypes.Int64BindVariable(1)}
logStats.AddRewrittenSQL("sql with pii", time.Now())
Expand All @@ -69,15 +69,15 @@ func TestLogStatsFormat(t *testing.T) {
*streamlog.RedactDebugUIQueries = false
*streamlog.QueryLogFormat = "text"
got := logStats.Format(url.Values(params))
want := "test\t\t\t''\t''\tJan 1 01:02:03.000000\tJan 1 01:02:04.000000\t1.000000\t\t\"sql\"\tmap[intVal:type:INT64 value:\"1\" ]\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t1\t\"\"\t\n"
want := "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql\"\tmap[intVal:type:INT64 value:\"1\" ]\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t1\t\"\"\t\n"
if got != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%q\n", got, want)
}

*streamlog.RedactDebugUIQueries = true
*streamlog.QueryLogFormat = "text"
got = logStats.Format(url.Values(params))
want = "test\t\t\t''\t''\tJan 1 01:02:03.000000\tJan 1 01:02:04.000000\t1.000000\t\t\"sql\"\t\"[REDACTED]\"\t1\t\"[REDACTED]\"\tmysql\t0.000000\t0.000000\t0\t1\t\"\"\t\n"
want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql\"\t\"[REDACTED]\"\t1\t\"[REDACTED]\"\tmysql\t0.000000\t0.000000\t0\t1\t\"\"\t\n"
if got != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%q\n", got, want)
}
Expand All @@ -94,7 +94,7 @@ func TestLogStatsFormat(t *testing.T) {
if err != nil {
t.Errorf("logstats format: error marshaling json: %v -- got:\n%v", err, got)
}
want = "{\n \"BindVars\": {\n \"intVal\": {\n \"type\": \"INT64\",\n \"value\": 1\n }\n },\n \"ConnWaitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"Jan 1 01:02:04.000000\",\n \"Error\": \"\",\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"MysqlTime\": 0,\n \"OriginalSQL\": \"sql\",\n \"PlanType\": \"\",\n \"Queries\": 1,\n \"QuerySources\": \"mysql\",\n \"RemoteAddr\": \"\",\n \"ResponseSize\": 1,\n \"RewrittenSQL\": \"sql with pii\",\n \"RowsAffected\": 0,\n \"Start\": \"Jan 1 01:02:03.000000\",\n \"TotalTime\": 1,\n \"Username\": \"\"\n}"
want = "{\n \"BindVars\": {\n \"intVal\": {\n \"type\": \"INT64\",\n \"value\": 1\n }\n },\n \"ConnWaitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"2017-01-01 01:02:04.000001\",\n \"Error\": \"\",\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"MysqlTime\": 0,\n \"OriginalSQL\": \"sql\",\n \"PlanType\": \"\",\n \"Queries\": 1,\n \"QuerySources\": \"mysql\",\n \"RemoteAddr\": \"\",\n \"ResponseSize\": 1,\n \"RewrittenSQL\": \"sql with pii\",\n \"RowsAffected\": 0,\n \"Start\": \"2017-01-01 01:02:03.000000\",\n \"TotalTime\": 1.000001,\n \"Username\": \"\"\n}"
if string(formatted) != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%v\n", string(formatted), want)
}
Expand All @@ -110,7 +110,7 @@ func TestLogStatsFormat(t *testing.T) {
if err != nil {
t.Errorf("logstats format: error marshaling json: %v -- got:\n%v", err, got)
}
want = "{\n \"BindVars\": \"[REDACTED]\",\n \"ConnWaitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"Jan 1 01:02:04.000000\",\n \"Error\": \"\",\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"MysqlTime\": 0,\n \"OriginalSQL\": \"sql\",\n \"PlanType\": \"\",\n \"Queries\": 1,\n \"QuerySources\": \"mysql\",\n \"RemoteAddr\": \"\",\n \"ResponseSize\": 1,\n \"RewrittenSQL\": \"[REDACTED]\",\n \"RowsAffected\": 0,\n \"Start\": \"Jan 1 01:02:03.000000\",\n \"TotalTime\": 1,\n \"Username\": \"\"\n}"
want = "{\n \"BindVars\": \"[REDACTED]\",\n \"ConnWaitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"2017-01-01 01:02:04.000001\",\n \"Error\": \"\",\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"MysqlTime\": 0,\n \"OriginalSQL\": \"sql\",\n \"PlanType\": \"\",\n \"Queries\": 1,\n \"QuerySources\": \"mysql\",\n \"RemoteAddr\": \"\",\n \"ResponseSize\": 1,\n \"RewrittenSQL\": \"[REDACTED]\",\n \"RowsAffected\": 0,\n \"Start\": \"2017-01-01 01:02:03.000000\",\n \"TotalTime\": 1.000001,\n \"Username\": \"\"\n}"
if string(formatted) != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%v\n", string(formatted), want)
}
Expand All @@ -123,7 +123,7 @@ func TestLogStatsFormat(t *testing.T) {

*streamlog.QueryLogFormat = "text"
got = logStats.Format(url.Values(params))
want = "test\t\t\t''\t''\tJan 1 01:02:03.000000\tJan 1 01:02:04.000000\t1.000000\t\t\"sql\"\tmap[strVal:type:VARCHAR value:\"abc\" ]\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t1\t\"\"\t\n"
want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql\"\tmap[strVal:type:VARCHAR value:\"abc\" ]\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t1\t\"\"\t\n"
if got != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%q\n", got, want)
}
Expand All @@ -138,7 +138,7 @@ func TestLogStatsFormat(t *testing.T) {
if err != nil {
t.Errorf("logstats format: error marshaling json: %v -- got:\n%v", err, got)
}
want = "{\n \"BindVars\": {\n \"strVal\": {\n \"type\": \"VARCHAR\",\n \"value\": \"abc\"\n }\n },\n \"ConnWaitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"Jan 1 01:02:04.000000\",\n \"Error\": \"\",\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"MysqlTime\": 0,\n \"OriginalSQL\": \"sql\",\n \"PlanType\": \"\",\n \"Queries\": 1,\n \"QuerySources\": \"mysql\",\n \"RemoteAddr\": \"\",\n \"ResponseSize\": 1,\n \"RewrittenSQL\": \"sql with pii\",\n \"RowsAffected\": 0,\n \"Start\": \"Jan 1 01:02:03.000000\",\n \"TotalTime\": 1,\n \"Username\": \"\"\n}"
want = "{\n \"BindVars\": {\n \"strVal\": {\n \"type\": \"VARCHAR\",\n \"value\": \"abc\"\n }\n },\n \"ConnWaitTime\": 0,\n \"Effective Caller\": \"\",\n \"End\": \"2017-01-01 01:02:04.000001\",\n \"Error\": \"\",\n \"ImmediateCaller\": \"\",\n \"Method\": \"test\",\n \"MysqlTime\": 0,\n \"OriginalSQL\": \"sql\",\n \"PlanType\": \"\",\n \"Queries\": 1,\n \"QuerySources\": \"mysql\",\n \"RemoteAddr\": \"\",\n \"ResponseSize\": 1,\n \"RewrittenSQL\": \"sql with pii\",\n \"RowsAffected\": 0,\n \"Start\": \"2017-01-01 01:02:03.000000\",\n \"TotalTime\": 1.000001,\n \"Username\": \"\"\n}"
if string(formatted) != want {
t.Errorf("logstats format: got:\n%q\nwant:\n%v\n", string(formatted), want)
}
Expand Down