Perl-Modul LoxBerry::Log

The module LoxBerry::Log contains functions for easy logging and notifications. 

The logfile feature enables LoxBerry-integrated logging including logging/debugging filters set by the user. With the shortcut functions it is very easy to create log entries, and filtering corresponding to the users loglevel is done by the module.

The notify features enable notifications in the user interface (the blue and/or red bullets overlaying icons and the navigation bar). 

Inclusion

use LoxBerry::Log;

The module automatically includes the modules

  • LoxBerry::System
  • JSON
  • Time::Piece
  • HTML::Entities
  • File::Basename
  • File::Path

Commands of this modules can directly be accesses without use'ing them. No error occurs, if the are use'd anyway.

See the usage of this module that was especially developed for easy use with LoxBerry.

Global variables

None.

List of severities for logging

LevelName Shortcut functionObject functionUse when
0 Emergency LOGEMERGE $obj→EMERGE … your LoxBerry burns
1 Alert LOGALERT $obj→ALERT … if the critical information also needs to be pushed to the user
2 Critical LOGCRIT $obj→CRIT … when user intervention is needed to continue operation
3 Error → DefaultLOGERR $obj→ERR … when an error occurs but

This is the default value in the plugin database
4 Warning LOGWARN $obj→WARN … when something is strange but does not stop operation
5 Notice LOGOK $obj→OK … is to inform the user that something went ok
6 Informational LOGINF $obj→INF … additional infos to any status
7 Debug LOGDEB $obj→DEB … for heavy debugging that a user normally don't need.

The object functions are called directly to the log object (e.g. if you have multiple logfiles).

The Shortcut functions always log to the default log object (the first log object).

Do not log higher severity levels just because you think the user should know this. 

Functions

Usage of the logging module

Datails can be found here: Usage of the logging module

Usage of the notification functions

Details can be found here: usage_of_the_notification_functions

Debugging

To debug the module, use that code in your program:

$LoxBerry::Log::DEBUG = 1;

This will send debugging messages to STDERR.