Logging in colorSpec package


There is some flexibility in the colorSpec logging level and format. There is no flexibility in the output, it all goes to the console using cat and print, but see sink.


The levels are: "FATAL", "ERROR", "WARN", "INFO", "DEBUG", and "TRACE" - the usual ones from Log4J. The initial level is "WARN".
A log event with level "ERROR" stops execution if the option stoponerror is TRUE.
A "FATAL" log event (e.g. internal error), always stops execution.

The format is given by a string with standard Log4J conversion specifications:

%t the date/time of the logging event. %t can be followed by standard strftime specs in braces; see example.
%l the level of the logging event
%n namespace where event occurred
%f function where event occurred
%m the message itself

See Also

cs.options, sink


cs.options( logformat="%t{%H:%M:%OS3} %l %n::%f(). %m" )

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.

comments powered by Disqus