-
Notifications
You must be signed in to change notification settings - Fork 1
reduce simulate info logs #102
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
reduce simulate info logs #102
Conversation
| formatSimulationLog(LogLevelWarning, message, fields...) | ||
| } | ||
|
|
||
| func formatSimulationError(message string, fields ...interface{}) { |
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.
nit: why not just use formatSimulationLog and let the callers decide the log level as in param, it saves some code, and easier for callers
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.
There is an argument for both. The choice here was to save having to write the log level as text which could lead to formatting issues.
| case LogLevelError: | ||
| levelColor = COLOR_RED | ||
| default: | ||
| levelColor = COLOR_BRIGHT_CYAN |
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.
does this color work across platforms, e.g. on windows, linux?
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.
This is a good catch. On further investigation it looks like we might run into some issues. I will add a cross platform solution
| } | ||
|
|
||
| // LogLevel represents different log levels for simulation logs | ||
| type LogLevel string |
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.
if we apply this to other cli modules, those lines should be moved out of simulation. I think cmd/common is a good place for it.
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. As per our discussion, it should stay here for now but later we should consider lifting it out into a central package
| // Create a minimal logger that discards output since we handle all logging through custom formatters | ||
| engineLogCfg := logger.Config{Level: zapcore.FatalLevel} | ||
|
|
||
| if inputs.EngineLogs { |
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.
not sure on this, how will we show engine logs after this change? easy to test with the -engine-logs flag on.
engine logs are needed to debug standalone engine. i dont think we need to format these logs. it is for pro users.
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 have added this back in on further testing
| COLOR_RESET = "\033[0m" | ||
| COLOR_RED = "\033[91m" // Bright Red | ||
| COLOR_GREEN = "\033[32m" // Green | ||
| COLOR_YELLOW = "\033[33m" // Yellow |
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.
These are not cross platform compatible
No description provided.