Skip to content

Instantly share code, notes, and snippets.

@horvaro
Created May 13, 2020 12:31
Show Gist options
  • Save horvaro/d7ac225026bd0804bf15debcee0a5c71 to your computer and use it in GitHub Desktop.
Save horvaro/d7ac225026bd0804bf15debcee0a5c71 to your computer and use it in GitHub Desktop.
Simple Bash Logger
#!/usr/bin/env bash
#Usage: log "Hello World!"
LOG_FORMAT="%Y-%m-%d %H:%M:%S %Z"
log() {
echo -e "[$(date +"${LOG_FORMAT}")] $1";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment