Skip to content
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

ConsoleHandler: fix for out of bounds array access with dynamic log level and coloured console output #421

Merged
merged 1 commit into from May 16, 2024

Conversation

usefulcat
Copy link
Contributor

When using a dynamic log level, ConsoleHandler::write() needs to get the log level by calling TransitEvent::log_level() instead of directly accessing the log level stored in MacroMetaData.

MacroMetadata::_log_level could be LogLevel::Dynamic, which will result in an out of bounds array access in ConsoleColours::colour_code().

Prior to this change, ConsoleHandler::write() was apparently not using the correct colour value for a dynamic log level (unless by accident).

When using a dynamic log level, ConsoleHandler::write() needs to get
the log level by calling TransitEvent::log_level() instead of directly
accessing the log level stored in MacroMetaData.
@odygrd
Copy link
Owner

odygrd commented May 16, 2024

thanks for the PR : )

@odygrd odygrd merged commit 72fe77e into odygrd:master May 16, 2024
25 checks passed
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.

None yet

2 participants