diff --git a/logger/db.go b/logger/db.go index c684855c087543acb668af1fa4e399a1de4b33f4..51867006c35d9165863b0745063ee2edcb05d7af 100644 --- a/logger/db.go +++ b/logger/db.go @@ -9,11 +9,11 @@ import ( type DbLogger struct{} -func (d DbLogger) BeforeQuery(c context.Context, q *pg.QueryEvent) (context.Context, error) { +func (d DbLogger) BeforeQuery(c context.Context, _ *pg.QueryEvent) (context.Context, error) { return c, nil } -func (d DbLogger) AfterQuery(c context.Context, q *pg.QueryEvent) error { +func (d DbLogger) AfterQuery(_ context.Context, q *pg.QueryEvent) error { sql, _ := q.FormattedQuery() if os.Getenv("DEBUGGING") == "true" { Debugf(string(sql)) diff --git a/logger/fields.go b/logger/fields.go deleted file mode 100644 index 4133d9ac1ea372e296f9e7b47ff8e185e055cc40..0000000000000000000000000000000000000000 --- a/logger/fields.go +++ /dev/null @@ -1,3 +0,0 @@ -package logger - -type Fields map[string]interface{} diff --git a/logger/format.go b/logger/format.go index e960f8117f20e7c624abf337fe724504fa7ec252..3ee49930eee3f01af282156e5d8ffec8b652cffc 100644 --- a/logger/format.go +++ b/logger/format.go @@ -16,10 +16,6 @@ type IFormatter interface { Color() string } -func NewJSON() IFormatter { - return formatterJSON{} -} - type formatterJSON struct{} func (f formatterJSON) Format(entry Entry) []byte { @@ -64,7 +60,6 @@ func (f formatterConsole) Format(entry Entry) []byte { red := color.New(color.FgRed).FprintfFunc() magenta := color.New(color.FgMagenta).FprintfFunc() yellow := color.New(color.FgYellow).FprintfFunc() - //blue := color.New(color.FgBlue).FprintfFunc() green := color.New(color.FgGreen).FprintfFunc() cyan := color.New(color.FgCyan).FprintfFunc() @@ -86,7 +81,7 @@ func (f formatterConsole) Format(entry Entry) []byte { cyan(buffer, fmt.Sprintf(" %-40.40s| ", source)) base := color.New(fgColors[colorNames[f.fg]], bgColors[colorNames[f.bg]]).FprintfFunc() - base(buffer, entry.Message) //buffer.Write([]byte(entry.Message)) + base(buffer, entry.Message) if len(entry.Data) > 0 { jsonData, _ := json.Marshal(entry.Data) @@ -141,10 +136,6 @@ func (f formatterConsole) NextColor() IFormatter { nextFg++ if nextFg >= len(fgColors) { nextFg = 0 - // nextBg++ - // if nextBg >= len(bgColors) { - // nextBg++ - // } } if nextFg != nextBg { break @@ -156,6 +147,5 @@ func (f formatterConsole) NextColor() IFormatter { fg: nextFg, bg: nextBg, } - //globalLogger.Debugf("NextColor return id=%d Color %s on %s", f.id, colorNames[f.fg], colorNames[f.bg]) return f }