PythonUtil: Remove unused "superlog" functions

This commit is contained in:
rdb 2023-02-20 20:59:33 +01:00
parent 17242e9a0a
commit 88a6484ab3

View File

@ -20,8 +20,7 @@ __all__ = [
'nullGen', 'loopGen', 'makeFlywheelGen', 'flywheel', 'listToIndex2item',
'listToItem2index', 'formatTimeCompact', 'deeptype', 'StdoutCapture',
'StdoutPassthrough', 'Averager', 'getRepository', 'formatTimeExact',
'startSuperLog', 'endSuperLog', 'typeName', 'safeTypeName',
'histogramDict', 'unescapeHtmlString',
'typeName', 'safeTypeName', 'histogramDict', 'unescapeHtmlString',
]
if __debug__:
@ -2401,42 +2400,6 @@ class Default:
# useful for keyword arguments to virtual methods
pass
superLogFile = None
def startSuperLog(customFunction = None):
global superLogFile
if not superLogFile:
superLogFile = open("c:\\temp\\superLog.txt", "w")
def trace_dispatch(a,b,c):
if b == 'call' and a.f_code.co_name != '?' and a.f_code.co_name.find("safeRepr") < 0:
vars = dict(a.f_locals)
if 'self' in vars:
del vars['self']
if '__builtins__' in vars:
del vars['__builtins__']
for i in vars:
vars[i] = safeReprTypeOnFail(vars[i])
if customFunction:
superLogFile.write( "before = %s\n"%customFunction())
superLogFile.write( "%s(%s):%s:%s\n"%(a.f_code.co_filename.split("\\")[-1],a.f_code.co_firstlineno, a.f_code.co_name, vars))
if customFunction:
superLogFile.write( "after = %s\n"%customFunction())
return trace_dispatch
sys.settrace(trace_dispatch)
def endSuperLog():
global superLogFile
if superLogFile:
sys.settrace(None)
superLogFile.close()
superLogFile = None
def configIsToday(configName):
# TODO: replace usage of strptime with something else
# returns true if config string is a valid representation of today's date