quill icon indicating copy to clipboard operation
quill copied to clipboard

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

Open usefulcat opened this issue 10 months ago • 0 comments

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).

usefulcat avatar Apr 16 '24 19:04 usefulcat