The level that is outputted can be set at runtime. If the plugin is set to plugins.Log.debugLevel("WARN"), only messages of priority WARN, ERROR and FATAL will be outputted.
Most developers use application.output(aMessage) during development and comment those out during deployment. With the Log-Plugin these messages can remain in the code for later debugging. By setting the priority to ERROR for exampe during deployment, debugging output can be prevented but still be accessible.
The plugin supports i18n messages, allows configuration of how messages are outputted, can output to the status area and display status area warning messages (shown in red).
Here is a short sample code that demonstrates the functionality:
// Set the Level from which on messages are outputted
plugins.Log.debugLevel = 'INFO';
// Create a log file to enable logging to a file
plugins.Log.logFilePath = 'C:\\test.log';
// Set the pattern in which messages are outputted
plugins.Log.outputPattern = '%s %p %d{HH:mm:ss.S}: %m%n';
// Output some messages
plugins.Log.trace('This is a trace message'); // Will not be outputted if debugLevel is 'INFO'
plugins.Log.debug('This is a debug message'); // Will not be outputted if debugLevel is 'INFO'
plugins.Log.info('This is a info message');
plugins.Log.warn('This is a warn message');
plugins.Log.error('This is a error message');
plugins.Log.fatal('This is a fatal message');
The output could look like this (depending on the outputPattern):
yourSolution 14:00:00.000 DEBUG: creating 100 records took 4375ms
Important notice: from version 1.5.1 on you need to register the plugin using a (free) license key.
The Log-Plugin is free, but requires registration. A free license key can be obtained from the shop in the Log-Plugin section by hitting the "GET IT" button and filling out the registration form. For a full list of changes for each version see the version history.
|