| logging {colorSpec} | R Documentation |
Logging in colorSpec package
Description
There is some flexibility in the colorSpec logging level and format.
Logging output goes to stderr(), just like the message stream;
but see sink() (and the pitfalls of using it).
Logging Options
colorSpec.loglevelThe levels are:
"FATAL", "ERROR", "WARN", "INFO", "DEBUG",and"TRACE"- the usual ones from Log4j. The initial level is"WARN". A"FATAL"event usually means an internal package error. When settingcolorSpec.loglevelan initial letter is sufficient.colorSpec.logformatThe format is given by a string with standard Log4j conversion specifications:
%tthe date/time of the logging event. %tcan be followed by standardstrftimespecs in braces; see example.%lthe level of the logging event %nnamespace where event occurred %ffunction where event occurred %mthe message itself colorSpec.stoponerrorIf the this option is
TRUE(the default), a log event with level"ERROR"stops execution; otherwise, execution keeps going. For interactive use,TRUEis probably better. For long batch jobs,FALSEmight be appropriate, since then a single error may not force a complete repeat.
A"FATAL"event always stops execution.
References
Wikipedia. Log4j. https://en.wikipedia.org/wiki/Log4j
See Also
options,
cs.options,
sink,
stderr
Examples
options( colorSpec.logformat="%t{%H:%M:%OS3} %l %n::%f(). %m", colorSpec.stoponerror=TRUE )
# or equivalently
cs.options( logformat="%t{%H:%M:%OS3} %l %n::%f(). %m", stop=TRUE )