Last active
August 29, 2015 14:27
-
-
Save Ellsworth/b4b41301fdc197f2dc43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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