-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: added console writer for local logging #123
Conversation
guacamole
commented
Mar 26, 2022
- pretty and readable logging for local debugging
8b736a9
to
2d88371
Compare
telemetry/consoleWriter.go
Outdated
e.Errors = append(e.Errors, err) | ||
} | ||
} else { | ||
_, err = buf.WriteString(color.RedString(" %d", res.Status)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guacamole can we do yellow for warn and red for error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also can we please move status up? like right after we calculate log level?
telemetry/consoleWriter.go
Outdated
e.Errors = append(e.Errors, err) | ||
} | ||
|
||
_, err = buf.WriteString(req.Method + " ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guacamole print method field before host
72373c0
to
c64ddec
Compare
l.Output(consoleWriter) | ||
return l | ||
} | ||
zerolog.SetGlobalLevel(zerolog.DebugLevel) | ||
return l | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guacamole can we remove this ZerologMiddleware? we don't use it anymore
- this way the handlers don't have to ctx.Set the error key each time and thus removing a bunch of repeated codes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guacamole LGTM 🥇 🥇 🥇