diff --git a/core/systems/debug/log.gd b/core/systems/debug/log.gd index 1606d0ed..e4347188 100644 --- a/core/systems/debug/log.gd +++ b/core/systems/debug/log.gd @@ -12,7 +12,8 @@ enum LEVEL { ERROR, ## Only log errors WARN, ## Log warnings and errors INFO, ## Log info, warnings, and errors - DEBUG, ## Log everything + DEBUG, ## Log debug, info, warnings, and errors + TRACE, ## Log everything } ## Returns a named logger for logging diff --git a/core/systems/debug/logger.gd b/core/systems/debug/logger.gd index 1e76a879..acb72c83 100644 --- a/core/systems/debug/logger.gd +++ b/core/systems/debug/logger.gd @@ -42,6 +42,14 @@ func set_level(level: Log.LEVEL) -> void: _level = level +func trace(message: Variant, xtra2: Variant = null, xtra3: Variant = null, xtra4: Variant = null, xtra5: Variant = null, xtra6: Variant = null): + if self._level < Log.LEVEL.TRACE: + return + var prefix := _format_prefix("TRACE", _get_caller()) + var msg := _stringify(message, xtra2, xtra3, xtra4, xtra5, xtra6) + print_rich("[color=magenta]", prefix, "[/color]", msg) + + func debug(message: Variant, xtra2: Variant = null, xtra3: Variant = null, xtra4: Variant = null, xtra5: Variant = null, xtra6: Variant = null): if self._level < Log.LEVEL.DEBUG: return