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
Merged

Conversation

Zirak
Copy link
Contributor

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

mcollina commented Aug 12, 2019 via email

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
Copy link
Contributor Author

Zirak commented Aug 12, 2019

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

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

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

@mcollina mcollina merged commit 7f19af0 into pinojs:master Aug 15, 2019
@Zirak Zirak deleted the patch-1 branch August 16, 2019 12:46
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