Log - nsrosenqvist/quickscript GitHub Wiki

Log

time_stamp()

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()

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()

log() 

Write the string provided to the log

Parameter Explanation
$1 (string) The log message

return (void) - void

author: Niklas Rosenqvist


log_msg()

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()

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()

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


⚠️ **GitHub.com Fallback** ⚠️