You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
400 B
Python
15 lines
400 B
Python
4 years ago
|
class KomradeException(Exception): pass
|
||
|
|
||
|
# make sure komrade is on path
|
||
|
import sys,os
|
||
|
sys.path.append(os.path.dirname(__file__))
|
||
|
|
||
|
import inspect
|
||
|
class Logger(object):
|
||
|
def log(self,*x):
|
||
|
curframe = inspect.currentframe()
|
||
|
calframe = inspect.getouterframes(curframe, 2)
|
||
|
mytype = type(self).__name__
|
||
|
caller = calframe[1][3]
|
||
|
print(f'\n[{mytype}.{caller}()]',*x)
|