Function for logging

Submitted by:Jhon Jhon

Date added:18 June, 2011

Category:Bash

You can create a function for logging system

Tags: logging function

Code Snippet:

function log {
NOW=$(date +'%Y-%m-%d %H:%M:%S')
echo "${NOW} - ${1}" >> sample_log.log
}
# Usage: log "This is a log entry."

< back to $HOME
 
 

Comments