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

Handle timestamp 0 in prettifyTime #76

Merged
merged 1 commit into from Aug 15, 2019

Conversation

@Zirak
Copy link
Contributor

Zirak commented Aug 12, 2019

When trying to format a log object like the following:

{
  "level": 30,
  "time": 0,
  "name": "foobar",
  "msg": "I like cake",
  "v": 1
}

pino-pretty previously tried to format the timestamp undefined instead of
taking the 0 time. This commit looks not at the truthiness of the value, but
its existence.

@Zirak

This comment has been minimized.

Copy link
Contributor Author

Zirak commented Aug 12, 2019

Sorry, I was optimistic and did this on the fly. When I get to a saner environment I'll look at how badly I broke things!

@mcollina

This comment has been minimized.

Copy link
Member

mcollina commented Aug 12, 2019

@Zirak Zirak force-pushed the Zirak:patch-1 branch from d0a3f98 to fdd7f67 Aug 12, 2019
When trying to format a log object like the following:

```json
{
  "level": 30,
  "time": 0,
  "name": "foobar",
  "msg": "I like cake",
  "v": 1
}
```

pino-pretty previously tried to format the timestamp `undefined` instead of
taking the `0` time. This commit looks not at the truthiness of the value, but
its existence.
@Zirak Zirak force-pushed the Zirak:patch-1 branch from fdd7f67 to f42786d Aug 12, 2019
@Zirak

This comment has been minimized.

Copy link
Contributor Author

Zirak commented Aug 12, 2019

Tested and corrected my kerfuffle, sorry about the extra noise.

Copy link
Member

mcollina left a comment

LGTM

Copy link
Contributor

jsumners left a comment

LGTM

@mcollina mcollina merged commit 7f19af0 into pinojs:master Aug 15, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Zirak Zirak deleted the Zirak:patch-1 branch Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.