Skip to content

Instantly share code, notes, and snippets.

View FottyM's full-sized avatar
🦥
Focusing

Fortunat Mutunda FottyM

🦥
Focusing
View GitHub Profile
#!/bin/bash
# Log function to print messages to stdout and stderr
function log {
if [ $1 == "success" ]; then
echo -e "\033[32m[`date +'%Y-%m-%d %H:%M:%S'`] $2\033[0m"
else
echo -e "\033[31m[`date +'%Y-%m-%d %H:%M:%S'`] $2\033[0m" >&2
fi
}