-
Notifications
You must be signed in to change notification settings - Fork 6
Logging changes #72
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
Logging changes #72
Conversation
This message is debug only and is making output noisy Signed-off-by: Andy Doan <andy@foundries.io>
fd45cac to
465ab34
Compare
internal/app.go
Outdated
| all_fname := make(map[string]bool) | ||
| for fname, cfgFile := range config.next { | ||
| slog.Info("Extracting file", "file", fname) | ||
| a.InfoLogger("Extracting file", "name", fname) |
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.
I wonder if we could configure slog in such the way that it modifies output format at the command initialization and does not require any changes in code that uses slog, so each slog.Info/Debug occurrences remain intact.
I believe @detsch investigated such possibility for zerolog, and answer was positive. Specifically, zerolog.Info would produce normal log like message in case of the daemon operation and terminal like output in case of the CLI commands. Now, we need to check it out for slog.
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.
Setting a custom slog logger when running in CLI mode seems more appropriate. It would allow the output changes we want without needing to replace slog.Info calls.
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.
I've force-pushed a new variation that is looking better to me.
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.
now - should I expose this log handler for Fioup to use, or should we just do the same/similar thing in that code base?
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.
now - should I expose this log handler for Fioup to use, or should we just do the same/similar thing in that code base?
Exposing the handler would be nice, so that we can easily keep the logic consistent among the tools.
The trailing period doesn't match our other logging logic and messes up with the format I'm trying to achieve in the next change Signed-off-by: Andy Doan <andy@foundries.io>
b39d9af to
b92c4f9
Compare
28a737d to
38274d5
Compare
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
38274d5 to
02aa690
Compare
No description provided.