blob: fdef0910e774e8e54edb544e463bf69ec40d0982 [file] [log] [blame]
koder aka kdanilov7acd6bd2015-02-12 14:28:30 -08001import os
2import sys
3import datetime
4
5
6def _log(x):
7 dt_str = datetime.datetime.now().strftime("%H:%M:%S")
8 pref = dt_str + " " + str(os.getpid()) + " >>>> "
9 sys.stderr.write(pref + x.replace("\n", "\n" + pref) + "\n")
10
11
12logger = _log
13
14
15def log(x):
16 logger(x)
17
18
19def setlogger(nlogger):
20 global logger
21 logger = nlogger