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

V5 docs #447

Merged
merged 11 commits into from
Jul 18, 2018
Merged

V5 docs #447

merged 11 commits into from
Jul 18, 2018

Conversation

davidmarkclements
Copy link
Member

@davidmarkclements davidmarkclements commented Jul 10, 2018

Apologies if the following explanation of changes/goals is dense, my tired brain has started to give up:

  • brings documentation inline with any api changes
  • bitesize reading through subject isolation
  • configure docsify with pino shades of green & other minor aesthetic adjustments
  • add pino tree to side bar
  • restructure api.md for (hopefully) improved clarity
  • use headers for API for easier linking to specific areas
  • restructure sidebar according to content changes
  • split out FAQ into Web Frameworks and Help
  • make the readme as focused as possible, navigation consistent with sidebar
  • reduce explanation footprints by removing slightly-off subject content, and/or replacing content with references using internal linking
  • focus on content ordering that makes most sense for quick referencing and learning through linear reading
  • consistent formatting
  • consistent pseudo-code notation (e.g. fn([param]) vs fn(param?) etc)
  • consistent markdown syntax

Todo

  • "Migration & Legacy" doc
  • re-read and apply corrections
  • make sure all links are working
  • make sure all external links are tagged with ⇗
  • make sure all heading levels are correct
  • probably go over the statics section again as it was done at the high tiredness levels
  • update benchmarks doc

image

image

image

image

@jsumners
Copy link
Member

This is a lot. I'll have to review over the weekend.

README.md Outdated

## Install

```
npm install pino --save
$ npm install pino --save
Copy link
Member

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.

Copy link
Member Author

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:
Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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.

Copy link
Member Author

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)
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member Author

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

Copy link
Member Author

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)
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/web.md Outdated
}
})
})
```
Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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

pinojs/restify-pino-logger@343930c

@@ -67,3 +67,6 @@ buffering.
In case a synchronous flush is needed, `dest.flushSync()` can be called.
Copy link
Member Author

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.

  1. Should we remove logger.flush
  2. OR should we rename it to logger.flushSync
  3. OR should we document the confusing nature of it

@mcollina @jsumners

Copy link
Member

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.
Copy link
Member

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
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

@jsumners jsumners left a 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.

davidmarkclements added 2 commits July 15, 2018 23:06
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants