log handlers: rotate and ring buffer

This commit is contained in:
Vladimir Mandic
2023-06-17 20:12:04 -04:00
parent a4ca27cf0b
commit fa35ea1516
9 changed files with 67 additions and 24 deletions
+9
View File
@@ -167,6 +167,13 @@ def progresssync():
return res
def get_log():
res = getsync('/sdapi/v1/log')
for l in res:
log.debug(l)
return res
def options():
opts = getsync('/sdapi/v1/options')
flags = getsync('/sdapi/v1/cmd-flags')
@@ -223,6 +230,8 @@ if __name__ == "__main__":
print(json.dumps(opt['options'], indent = 2))
log.debug({ 'cmd-flags' })
print(json.dumps(opt['flags'], indent = 2))
if 'log' in sys.argv:
get_log()
if 'shutdown' in sys.argv:
shutdown()
asyncio.run(close(), debug=True)