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

🙋Add verbose logging mode #993

Closed
fregante opened this issue Mar 13, 2018 · 10 comments
Closed

🙋Add verbose logging mode #993

fregante opened this issue Mar 13, 2018 · 10 comments

Comments

@fregante
Copy link
Contributor

fregante commented Mar 13, 2018

Choose one: is this a 🐛 bug report or 🙋 feature request?

🙋 feature request

It's impossible to debug an issue or to show anyone if I can't see what's happening. All logging messages are replaced one the build is done.

🎛 Configuration (.babelrc, package.json, cli command)

parcel watch

🤔 Expected Behavior

$ parcel watch --verbose
Server running at http://localhost:1234 
⏳  Building index.html...
⏳  Building index.js...
✨  Built in 3.78s.
⏳  Building index.js...
✨  Built in 0.78s.
⏳  Building index.html...
✨  Built in 0.1s.

😯 Current Behavior

$ parcel watch
Server running at http://localhost:1234 
✨  Built in 3.78s.
# what happened?! what did it do?

🔦 Context

Mostly for debugging purposes

🌍 Your Environment

Software Version(s)
Parcel 1.6.2
Node 8.6.0
npm/Yarn 5.7.1
Operating System macOS 10.13.3
@davidnagli
Copy link
Contributor

This should be VERY easy to implement 😃 😇 🚀

We already have an option called logLevel that we use internally. So it's just a matter of exposing that in src/cli.js.

The easiest way to do it is to make the CLI option called --logLevel [level] which would just take the that level as a parameter directly (however this would probably require us to document how those log levels actually work).

If you just add that to the commands in src/cli.js, it should just automatically start working, since the code that parses that option already exists 👍

@DeMoorJasper
Copy link
Member

@davidnagli We don't have a verbose level though, this would require someone to add an extra level to the loglevel value for example go up to lvl 4 instead of 3, 4 being verbose

@davidnagli
Copy link
Contributor

@DeMoorJasper How is lvl 3 different from the verbose mode that @bfred-it is describing?

What would be new in lvl 4?

@DeMoorJasper
Copy link
Member

If i understand correctly the difference would be that it prints everything (like not overwriting status but just taking a newline every time)

@davidnagli
Copy link
Contributor

Gochya 👍

We should probably document the log levels somewhere. From what I pieced together:

logLevel Behavior
0 No output
1 Errors
2 Warnings + Errors
3 All
4 [Proposed] Verbose

@TomVance
Copy link

Is this issue still being worked on? I'd be interested in starting to contribute too this project and this seems like a good starting point.

@Hammster
Copy link
Contributor

Hammster commented Jun 18, 2018

@TomVance #1385 is the PR that contains the verbose output and also a log file generation. If you find something there that is missing feel free to contribute based on the PR. 😉

@jaredscheib
Copy link

This would be super helpful! Two engs here (myself included) just spent a day trying to figure out when our Parcel build was hanging – as in, which file it was hung up on. Without an option to capture the output, we had no insight.

(Side note: It turned out to be a node-sass absolute vs relative import problem on an ubuntu:trusty Docker image, which we'd also like to submit an issue for but haven't figured out how to reliably reproduce the environment for you yet.)

@DeMoorJasper
Copy link
Member

I'll open up a new PR that does the same as my current one but without any log calls, as I haven't had the chance to reliably performance test the difference (and there are a couple merge conflicts)

@tms57
Copy link

tms57 commented Apr 11, 2020

So once I add --log-level 2 to my start script, where CAN I SEE IT?
Is it written to a file, & if so, WHERE?

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

7 participants