ClassLogger
It's a Logger with the class already supplied.
Description
This is a ClassLogger that logs with a standardised prefix in the form of:
A ClassLogger already has 'ModClass' supplied through being created using for_class. It's also possible to provide a unique prefix formatter using set_formatter or with_formatterMethods
void | debug ( int line, String message, Array args ) |
void | error ( int line, String message, Array args ) |
void | fatal ( int line, String message, Array args ) |
ClassLogger | for_class ( clazz ) |
void | info ( int line, String message, Array args ) |
void | set_formatter ( FuncRef prefix_formatter = PREFIX_FORMATTER ) |
void | warn ( int line, String message, Array args ) |
ClassLogger | with_formatter ( FuncRef prefix_formatter = PREFIX_FORMATTER ) |
Enumerations
enum LogLevel:
Denotes the log level.
Constants
FuncRef | MILLIS_PREFIX_FORMATTER | funcref(self, "build_prefix_millis") |
FuncRef | PREFIX_FORMATTER | funcref(self, "build_prefix") |
Method Descriptions
ClassLogger for_class ( clazz ):
Creates a ClassLogger which pre-supplies the clazz for the logging methods. clazz may be either a String containing the class name or a relevant instance of the class/ the GDScript itself with a CLASS_NAME constant providing the name as a String.
void debug ( int line, String message, Array args ):
Logs a message at debug level. line denotes the line number and args is the parameters the message will be formatted with. line and args may each be omitted.
void info ( int line, String message, Array args ):
Logs a message at info level. line denotes the line number and args is the parameters the message will be formatted with. line and args may each be omitted.
void warn ( int line, String message, Array args ):
Logs a message at warn level. line denotes the line number and args is the parameters the message will be formatted with. line and args may each be omitted.
void error ( int line, String message, Array args ):
Logs a message at error level. line denotes the line number and args is the parameters the message will be formatted with. line and args may each be omitted.
void fatal ( int line, String message, Array args ):
Logs a message at fatal level. line denotes the line number and args is the parameters the message will be formatted with. line and args may each be omitted.
void set_formatter ( FuncRef prefix_formatter = PREFIX_FORMATTER ):
Sets prefix_formatter as this loggers prefix formatter. The prefix formatter is a FuncRef to any method with signature:
ClassLogger with_formatter ( FuncRef prefix_formatter = PREFIX_FORMATTER ):
Creates and returns a new ClassLogger with prefix_formatter as the loggers prefix formatter. The prefix formatter is a FuncRef to any method with signature: