-
Notifications
You must be signed in to change notification settings - Fork 854
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
V5 docs #447
V5 docs #447
Conversation
e979880
to
bb31ed7
Compare
This is a lot. I'll have to review over the weekend. |
README.md
Outdated
|
||
## Install | ||
|
||
``` | ||
npm install pino --save | ||
$ npm install pino --save |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can omit --save
now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
README.md
Outdated
``` | ||
|
||
If you need support for Node.js v0.12 or v0.10, please install the latest 2.x release using the `legacy` tag: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add a section on pino v4 and pino v2 somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
– todo: add docs/migration-and-legacy.md
docs/api.md
Outdated
The options object may additionally contain a `prettifier` property to define | ||
which prettifier module to use. When not present, `prettifier` defaults to | ||
`'pino-pretty'`. Regardless of the value, the specified prettifier module | ||
must be installed as a separate dependency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add an npm install pino-pretty
line here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
docs/api.md
Outdated
<a id="metadata"></a> | ||
# Metadata | ||
* See [Extreme mode ⇗](extreme.md). | ||
* See [`sonic-boom` ⇗](https://github.com/mcollina/sonic-boom) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also point to pino-multi-stream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hold on I think you've read the removed lines - this isn't the metadata section (that was moved under destination option), this is the pino-extreme secion. I've added a link to pino-multi-stream from there instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/web.md
Outdated
logger: true | ||
}) | ||
fastify.get('/', async (request, reply) => { | ||
reply.type('application/json').code(200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is redundant and not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
||
```js | ||
const fastify = require('fastify')({ | ||
logger: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can add a comment about passing the logging options to fastify logger: { opts }
.
Note that fastify 1 will still be using Pino v4, and we will move to Pino v5 in fastify 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so I'll add two additional notes underneath the code I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/web.md
Outdated
} | ||
}) | ||
}) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the latest example in hapi-pino that covers Hapi v17.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed
server.listen(3000) | ||
``` | ||
|
||
See the [restify-pino-logger readme](http://npm.im/restify-pino-logger) for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work with latest restify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, need to check. If not we'll need to update restify-pino-logger.
In any case, this won't affect the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of course it would affect the docs what am I talking about.
anyway, it does, the syntax since restify v4 is largely unchanged for initialization
updated dev dep in restify-pino-logger from v4 to v7, tests pass and example works
@@ -67,3 +67,6 @@ buffering. | |||
In case a synchronous flush is needed, `dest.flushSync()` can be called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems to me that the logger.flush
method is a footgun then, since logger.flush
calls flushSync
and not flush
- with no warning about data loss in the docs.
- Should we remove
logger.flush
- OR should we rename it to
logger.flushSync
- OR should we document the confusing nature of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check how much of this is done in #423? I’m definitely +1 to rename it to flushSync, and maybe also have a flush that’s async.
docs/extreme.md
Outdated
`process.exit(1)` otherwise. If you do supply an `onTerminated` function, it | ||
is left up to you to fully terminate the process. | ||
`process.exit(1)` otherwise. If an `onTerminated` function is supplied, it | ||
us the responsibility of the `onTerminated` function to manually exit the process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
us
=> is
* [Pino with `debug`](#debug) | ||
|
||
<a id="rotate"></a> | ||
## Log rotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a link in here somewhere to https://www.nearform.com/blog/sematext-guest-post-pino-fastest-node-js-logger-production/ with a specific mention of using logagent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't link out to blog posts in general.. I think that will become a burden to maintain over time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I haven't been able to pore over every word, but it looks great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
445005d
to
f4683d2
Compare
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Apologies if the following explanation of changes/goals is dense, my tired brain has started to give up:
fn([param])
vsfn(param?)
etc)Todo