Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

logging

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.loglevel

The 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 setting colorSpec.loglevel an initial letter is sufficient.

colorSpec.logformat

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
colorSpec.stoponerror

If the this option is TRUE (the default), a log event with level "ERROR" stops execution; otherwise, execution keeps going. For interactive use, TRUE is probably better. For long batch jobs, FALSE might be appropriate, since then a single error may not force a complete repeat.
A "FATAL" event always stops execution.

References

See Also

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 )

colorSpec

Color Calculations with Emphasis on Spectral Data

v1.2-1
GPL (>= 3)
Authors
Glenn Davis [aut, cre]
Initial release
2020-04-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.