-
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
Add structured logging (first version) #254
Conversation
Allow us to intercept the logging and use different technics to log messages
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.
Fantastic! 🤩
Does that mean that logs are automatically parsed in google cloud log explorer or is there additional setup needed?
go-chaos/internal/logging.go
Outdated
"fmt" | ||
) | ||
|
||
func VerbosityLogging(text string, a ...any) { |
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.
🙃 names are too long IMO, I'd either move them to a new package called log
so calls can look like log.Verbose(...)
and log.Info(...)
, or leave them in the internal
package but rename the function to LogInfo(...)
and LogVerbose(...)
or similar.
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.
Yeah was also not sure about them. I didn't wanted to conflict to much with the normal log package and functions
If it is deployed in gke it will automatically pushed to stackdriver, which will parse it afaik. |
Future: Worker can add variables to the logger, like experiment name etc.
Example:
With json logging
Normal: