-
Notifications
You must be signed in to change notification settings - Fork 53
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
cli: also log applier debug messages to debug log file #3457
Conversation
✅ Deploy Preview for constellation-docs canceled.
|
@@ -227,7 +227,7 @@ func runApply(cmd *cobra.Command, _ []string) error { | |||
} | |||
|
|||
fileHandler := file.NewHandler(afero.NewOsFs()) | |||
logger, err := newDebugFileLogger(cmd, fileHandler) | |||
debugLogger, err := newDebugFileLogger(cmd, fileHandler) |
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 don't understand why we have two loggers in this func. Should we just log everything with this logger?
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.
The other logger log
is now only used in the warnLogger, which in turn is only used https://github.com/edgelesssys/constellation/blob/euler/cli/extend-file-debug-log/cli/internal/cmd/applyinit.go#L33. I think in general terms, we want to print warning non-structured, so not with slog.
The simplest solution would be to use the debugLogger instead of log when creating the warnLogger and in the warnLogger's implementation we debug log additionally when calling Warn.
EDIT: this would print the warning twice to the user, once structured and once unstructured when debug is enabled, which is fine in my opinion.
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.
The current state (last commit) is a proposal for this version.
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 agree that printing the warning as structured debug log again is fine.
Coverage report
|
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.
LGTM
* cli: also log applier debug messages to debug log file * cli: use debug logger instead of cliLogger
Context
Currenlty, when the coordinator is not reachable, the last log line is
Proposed change(s)
Now the logs also containt he following messages each time the CLI tries to init (those were previously only available directly in the cli output but not in the constellation-debug.log file)
Checklist