import json, sys ########################### LOGFILES ######################### sChunkSep = '---' ## A single line like this separates chunks in a logfile ############################################################################################## ###################### Logfile I/O ##################### ############################################################################################## ## PROBLEM: JSON does not allow appending. ## WORKAROUND: separate [JSON] chunks by '---', inspired by https://github.com/pvorb/jsml. ## Writing an arbitrary chunk: ensure end-of-line before separator def writeLogChunk( wf, ch ): ss = ch.__str__() wf.write( ss ) if 0