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 a development mode #19

Open
Nargonath opened this issue May 7, 2021 · 1 comment
Open

Add a development mode #19

Nargonath opened this issue May 7, 2021 · 1 comment
Labels
feature New functionality or improvement

Comments

@Nargonath
Copy link
Member

Nargonath commented May 7, 2021

Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: N/A
  • module version: latest
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): hapi
  • any other relevant information:

What problem are you trying to solve?

As discussed among TSC members, it would be nice to have a development mode for the logs. It would be false by default but once enabled it would print to stdout a bunch of useful information while developing:

  • Errors
  • Responses:
    • Status code
    • Path
    • Method
    • Response time

All with a nice format. Perhaps if we even want to get fancy we could use chalk or something like that for pretty colors.

Do you have a new or modified API suggestion to solve the problem?

I suggest we had a new root field in the plugin registration options:

{
  dev: false
}

This field would be false by default. Another name for the field could be development if we prefer that.

@Nargonath Nargonath added the feature New functionality or improvement label May 7, 2021
@Nargonath Nargonath changed the title Development mode Add a development mode May 7, 2021
@geek
Copy link
Member

geek commented May 10, 2021

I think #20 will address this request. You can run the new example and remove the level argument or change it to "debug" to see the request output. If you install pino-pretty you can run it like: node example/pinoLogger.js | pino-pretty --colorize and then you will see all of the output that you mentioned above in a colorized format.

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

No branches or pull requests

2 participants