Skip to content

Conversation

@timothyF95
Copy link
Contributor

No description provided.

@timothyF95 timothyF95 marked this pull request as ready for review October 20, 2025 16:10
@timothyF95 timothyF95 requested a review from a team as a code owner October 20, 2025 16:10
formatSimulationLog(LogLevelWarning, message, fields...)
}

func formatSimulationError(message string, fields ...interface{}) {
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor Author

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

@timothyF95 timothyF95 enabled auto-merge October 23, 2025 20:37
@timothyF95 timothyF95 added this pull request to the merge queue Oct 23, 2025
Merged via the queue into main with commit 9bdaa9c Oct 23, 2025
16 checks passed
@timothyF95 timothyF95 deleted the feature/DEVSVCS-2816/reduce-simulate-info-logs branch October 23, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants