Target of this module is supply logging features to user and to dbrm itself.
Variable Description LOGFILE
Contains path of logfile to use. If this variable is not set call to write command do nothing.
With info command is possible retrieve status of the logfile
module and what is current logfile use for store logging string.
$# dbrm logfile info
===========================================================================
Module [logfile]:
---------------------------------------------------------------------------
Logfile = ./dbm.log
Status = 1
---------------------------------------------------------------------------
===========================================================================
Remove current logfile.
Exit Values:
1
: On error or if logfile module is not enabled.0
: On success $# dbrm logfile reset
Are you sure to remove file ./dbm.log ? [y/N]y
File ./dbm.log removed correctly.
This command permit from a shell logging message to configured logfile. Every message contains a date and a line as seperator.
Exit Values:
1
: On error0
: On success $# dbrm logfile write "INFO - Test logging"
$# cat ./dbm.log
------------------------------------------------------
20170422-18:58:34 - INFO - Test logging
------------------------------------------------------
Method called when module logfile is initialized. Check if it is defined LOGFILE variable and check if file is writable. If LOGFILE variable is not set then logfile module is automatically disabled.
(Show/Hide)Internal function that write input message to logfile.
Parameters:
$1
: message to write on logfileReturns:
1
: On error0
: On success # Write message to logfile
_logfile_write "My message to write on LOGFILE!!!"