This is a simple logger used to make uniform outputs across W4M tools.
See get_logger for example usages.
A W4MLogger instance
character vector of length 1 - The name of the logger. Use different loggers with a name specific to each part of you program. The name will appear in the log prefix and helps to determine which part of the program did what
character vector of length 1 - The format string for each
log line. The default is :
"[{{ level }}-{{ name }}-{{ time }}] - {{ message }}"
logical vector of length 1 - By default, the logger
uses special control character to give some coloring to the text,
depending on the log level (info, warning, error, debug or verbose).
This coloring is deactivated in files and if
W4MRUtils::in_galaxy_env()
returns TRUE. You can force or
deactivate the coloring with this parameter.
logical vector of length 1 - Tells whether the debug logs must be displayed/written or not. Default is FALSE
logical vector of length 1 - Tells whether the verbose logs must be displayed/written or not. Default is FALSE
logical vector of length 1 - Tells whether the info logs must be displayed/written or not Default is TRUE.
logical vector of length 1 - Tells whether the warning logs must be displayed/written or not Default is TRUE.
logical vector of length 1 - Tells whether the error logs must be displayed/written or not Default is TRUE.
named list - This lists maps a logging level to
its coloring. Like this: list(debug = "purple", info = "green")
Available colors can be found in W4MRUtils::w4m_colors__
.
function - the default function to print messages
in the terminal. The default is base::message
.
list of file paths - Provide a list of file path where the logs will be written. It is not possible to separate different levels of logs in different log files for the moment.
L.Pavot
W4MLogger$info, W4MLogger$warning, W4MLogger$error, W4MLogger$debug, W4MLogger$verbose