exscript icon indicating copy to clipboard operation
exscript copied to clipboard

CLI: Add sys.message() and timestamps to log

Open lathspell opened this issue 7 years ago • 2 comments

I noticed that my sys.message() output is not in the logfiles created with "-l" of the CLI. It would be nice if they would as I could then "grep" those logs to get a small statistic at the end of a run. e.g. how many devices where skipped due to some condition and how many where processed as planned.

Also it would be nice if those logfiles would include a timestamp on every line. That way one could see if a certain command always took e.g. 50-55s and if it then fails at a timeout of 60s it was no "problem" but rather just a too low timeout setting.

lathspell avatar Jul 26 '18 08:07 lathspell

While that makes sense, I would worry about runtime effects. Essentially, the response from the device is a constant stream; the message would need to be inserted into that stream and may affect post-processing there. I am not sure how and where to best modify the stream to prevent any problems.

knipknap avatar Aug 28 '18 17:08 knipknap

A constant stream maybe a but CLI it's usually a line based one so you could add sys.message() output or timestamps right after the next newline you output. Timestamping could work like "ls -al | ts" on the shell which prefixes every line with the current timestamp.

lathspell avatar Aug 29 '18 08:08 lathspell