Simple extensible logger for Godot 4.x
Note: You should add addons/bloody_logger/logger.gd
as Autoload
Somewhere in your project you should setup loggers like this:
# logger.gd is autoloaded as "Logger"
Logger.add_writer(BloodyLogger.default_console_writer())
Logger.add_writer(BloodyLogger.default_error_file_writer())
This snippet above is more than enough for basic funcitonality. If default writers aren't enough, you can create your own.
To create your own writer, you should:
- extend
Writer
class - override
write(int, String)
andwrite_stack(int, String)
functions
Please note, that you despite of presence of _filter(int)
function, you should call it your custom overrides manually.