MCPcopy Create free account
hub / github.com/EDCD/EDDN / echoLog

Function echoLog

examples/Python 2.7/Client_Complete.py:49–72  ·  view source on GitHub ↗
(__str)

Source from the content-addressed store, hash-verified

47
48__oldTime = False
49def echoLog(__str):
50 global __oldTime, __logVerboseFile
51
52 if __logVerboseFile != False:
53 __logVerboseFileParsed = __logVerboseFile.replace('%DATE%', str(date('%Y-%m-%d')))
54
55 if __logVerboseFile != False and not os.path.exists(__logVerboseFileParsed):
56 f = open(__logVerboseFileParsed, 'w')
57 f.write('<style type="text/css">html { white-space: pre; font-family: Courier New,Courier,Lucida Sans Typewriter,Lucida Typewriter,monospace; }</style>')
58 f.close()
59
60 if (__oldTime == False) or (__oldTime != date('%H:%M:%S')):
61 __oldTime = date('%H:%M:%S')
62 __str = str(__oldTime) + ' | ' + str(__str)
63 else:
64 __str = ' ' + ' | ' + str(__str)
65
66 print __str
67 sys.stdout.flush()
68
69 if __logVerboseFile != False:
70 f = open(__logVerboseFileParsed, 'a')
71 f.write(__str + '\n')
72 f.close()
73
74
75def echoLogJSON(__json):

Callers 1

mainFunction · 0.70

Calls 1

dateFunction · 0.70

Tested by

no test coverage detected