Skip to content

Instantly share code, notes, and snippets.

@Ellsworth
Last active August 29, 2015 14:27
Show Gist options
  • Save Ellsworth/b4b41301fdc197f2dc43 to your computer and use it in GitHub Desktop.
Save Ellsworth/b4b41301fdc197f2dc43 to your computer and use it in GitHub Desktop.
import time
import datetime
import colorama
def createmsg(msgtype, msg):
# get the time and date
timestamp = datetime.datetime.fromtimestamp(time.time()).strftime('[%m-%d-%Y %H:%M:%S]')
if msgtype == "INFO":
print(timestamp + " [ INFO ] --- " + msg)
if msgtype == "FAIL":
print(timestamp + " [" + colorama.Fore.RED + " FAIL " + colorama.Fore.RESET + "] --- " + msg)
if msgtype == "PASS":
print(timestamp + " [" + colorama.Fore.GREEN + " PASS " + colorama.Fore.RESET + "] --- " + msg)
if msgtype == "WARN":
print(timestamp + " [" + colorama.Fore.YELLOW + " WARN " + colorama.Fore.RESET + "] --- " + msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment