Log - nsrosenqvist/quickscript GitHub Wiki
time_stamp()
Returns a timestamp of the date and time right now
return (string) - The date and time right now
author: Niklas Rosenqvist
log_file()
The path to the log file
If logging is disabled it returns /dev/null so that the users doesn't need to worry about using different functions. The global variable LOG_DIR can be set to decide where the script outputs it's log
return (string) - The path to the log file
author: Niklas Rosenqvist
log()
Write the string provided to the log
Parameter | Explanation |
---|---|
$1 (string) | The log message |
return (void) - void
author: Niklas Rosenqvist
log_msg()
Write the string provided to the log with a [MSG] tag
Parameter | Explanation |
---|---|
$1 (string) | The log message |
return (void) - void
author: Niklas Rosenqvist
log_wrn()
Write the string provided to the log with a [WRN] tag
The user also has the option to pass the $LINENO as the second argument
Parameter | Explanation |
---|---|
$1 (string) | The log message |
$2 (string) | Optionally the line number of the call |
return () - void
author: Niklas Rosenqvist
log_err()
Write the string provided to the log and stderr with a [ERR] tag
The user also has the option to pass the $LINENO as the second argument
Parameter | Explanation |
---|---|
$1 (string) | The log message |
$2 (string) | Optionally the line number of the call |
return () - void
author: Niklas Rosenqvist