This class provides methods to support the logging functionality of FlowPDF. Framework code uses special static instance.
- A few points to note about logging.
-
-
The log level which is retrieved from the debugLevel property in the configuration, control which messages get written to the logs.
-
+ The Methods provided by this class facilitate the classification of a
- message into any one of the following.
-
-
Log
-
Debug
-
Trace
-
Warning
-
Error
-
-
The log level and the classification of messages work together to surface the severity of a message.
-
Regardless of the log level Warning and Error Messages will always be written.
-
Logged messages are appropriately prefaced by [DEBUG], [TRACE], [WARNING], [ERROR] based on their classification.
-
It supports the following log levels:
-
INFO
This is the default level.
debugLevel property should be set to 0.
-
DEBUG
Provides the same output from INFO level + debug output.
debugLevel property should be set to 1.
-
TRACE
Provides the same output from DEBUG level + TRACE output.
debugLevel property should be set to 2.
Log can be used in two ways: With an instance. FlowPlugin
contains a
'log' property with an initialized Log object that one can use:
void stepSampleStep(StepParameters sp, StepResult sr){ log.info("Sample info log message") log.setLogLevel(LOG_TRACE) log.trace("Sample trace log message") }
With static imported methods:
import static com.cloudbees.flowpdf.Log.* void stepSampleStep(StepParameters sp, StepResult sr){ logInfo("Sample log message") setDefaultLogLevel(LOG_TRACE) logTrace("Sample trace log message") }
Following methods are available for an instance.
setLogLevel(def newLogLevel)
setDefaultLogLevel(def newLogLevel)
Sets new static instance log level. Also, all new Log instances will have this log level.