Skip to main content

Logger (logger)

Allows for colored output, better newlines, multiple logger levels and a large variety of placeholders usable in 'config_format'.

Signals

log_event

  • Signature: bool allowed, CoreTypes.LoggerLevel level, String origin, String message, String format \

Emitted on any log call, permitted or not.
format is set to "" when allowed is set false.

Variables

bool verbose_mode = false

Used to determine if running in verbose/command line mode. Makes diagnostic log messages display correctly (workaround for Godot's ANSI true color limitation).

Functions

void diag(String origin, String message)

Prints a diagnostic message.

void verb(String origin, String message)

Prints a verbose message.

void info(String origin, String message)

Prints an informational message.

void warn(String origin, String message)

Prints a warning message.

void error(String origin, String message)

Prints an error message.

void crash(String origin, String message, bool framework_crash = false)

Awaiting required

Using the await keyword is required for this function.

danger

Don't set framework_crash to true, thanks!

Handles crashes. Will terminate your game/application immediately.

bool is_level_allowed(CoreTypes.LoggerLevel level)

Checks if the specified log level is allowed by the current configuration.

CoreLoggerInstance get_instance(String origin, Object parent)

Returns a CoreLoggerInstance, which is a fancy word meaning you don't need to pass origin every time you want to log something.