-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.py
31 lines (22 loc) · 919 Bytes
/
logger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import sys
import time
import datetime
#simple logging class, call the type of message, pass in a string
class Logging(object):
#TODO add filepath handling from sys
def __init__(self, filepath=""):
self.filepath = filepath
self.start = datetime.datetime.utcnow()
print "[log] started {}" .format(self.start)
def error(self, msg):
print "[error] {}".format(datetime.datetime.utcnow()), msg
def info(self, msg):
print "[info] {}".format(datetime.datetime.utcnow()), msg
def warning(self, msg):
print "[warning] {}".format(datetime.datetime.utcnow()), msg
def terminate(self, msg):
print "[terminated] {}".format(datetime.datetime.utcnow()), msg
def refresh(self, msg):
print "[refresh] {}".format(datetime.datetime.utcnow()), msg
def clockout(self):
print "[clock] {}".format(datetime.datetime.utcnow())