Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clasp logs --watch --simplifed returns log with timestamp #795

Open
leeyspaul opened this issue Jul 17, 2020 · 3 comments
Open

clasp logs --watch --simplifed returns log with timestamp #795

leeyspaul opened this issue Jul 17, 2020 · 3 comments

Comments

@leeyspaul
Copy link

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
@guywithacube
Copy link

After doing some cursory git-blaming from within Github, I believe this issue was introduced by #778, though, I may be incorrect.

@PopGoesTheWza
Copy link
Collaborator

This issue cause is likely here:

clasp/src/commands/logs.ts

Lines 212 to 215 in ee70a6a

// Only print filter if provided.
if (filter.length > 0) {
console.log(filter);
}

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?

@PopGoesTheWza
Copy link
Collaborator

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants