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 output mode option to logs command #1131

Merged
merged 2 commits into from Feb 26, 2018
Merged

Add output mode option to logs command #1131

merged 2 commits into from Feb 26, 2018

Conversation

cpetzold
Copy link
Contributor

Adds the following option to now logs:

-o MODE, --output=MODE         Specify the output format (short|raw) [short]

The short mode is default and what the logs currently output, and raw just logs the stringified object or text. I wasn't sure what to do about req/res logs, so need some help there.

Getting the raw log is useful for people using something like bunyan:

$ now logs myapp.now.sh -o raw | bunyan
npm start

> myapp@0.0.1 start /home/nowuser/src
> node server.js

07:46:42.707Z  INFO myapp: start
07:46:42.709Z  INFO myapp: creating a wuzzle (widget_type=wuzzle)
07:46:42.709Z  WARN myapp: This wuzzle is woosey. (widget_type=wuzzle)
07:46:42.709Z  INFO myapp: done

@leo leo requested a review from nkzawa February 24, 2018 19:30
@leo leo merged commit a6fe795 into vercel:canary Feb 26, 2018
@leo
Copy link
Contributor

leo commented Feb 26, 2018

Great addition, @cpetzold! Thank you ☺️

@cpetzold
Copy link
Contributor Author

Awesome, thanks! I love the project and Zeit, keep up the good work!

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

Successfully merging this pull request may close these issues.

None yet

3 participants