`clasp logs --watch --simplifed` returns log with timestamp
It's highly possible that I am doing something wrong. But I'm receiving the timestamps when passing in both flags of --watch and --simplified.
I am not sure if this is the behavior that was intended.
Thank you!
Expected Behavior
$ clasp logs --watch --simplified
DEBUG N/A {"message":"hello there!","serviceContext":{"service":"..."}}
Actual Behavior
$ clasp logs --watch --simplified
timestamp >= "2020-07-17T02:44:40.069Z"
timestamp >= "2020-07-17T02:44:46.071Z"
DEBUG N/A {"message":"hello there!","serviceContext":{"service":"..."}}
timestamp >= "2020-07-17T02:44:46.071Z"
Specifications
- Node version (
node -v): v10.10.0 - Version (
clasp -v): 2.3.0 - OS (Mac/Linux/Windows): Mac
After doing some cursory git-blaming from within Github, I believe this issue was introduced by https://github.com/google/clasp/pull/778, though, I may be incorrect.
This issue cause is likely here:
https://github.com/google/clasp/blob/ee70a6ae743d3b28b27b2c5cc6ca3e70c64f465b/src/commands/logs.ts#L212-L215
These lines are run every time ˋfetchAndPrintLogsˋ is invoked.
That part of the code would need some revision so that under ˋwatchˋ option it only displays once.
Anyone wants to draft a PR?
@leeyspaul Just to be sure the issue still exist, can you try replacing @google/clasp 2.3.0 with forked-clasp which is more advanced?
npm uninstall -g @google/clasp
npm install -g forked-clasp