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

Bug: Arrays and Dates stopped displaying correctly #80

Closed
flybayer opened this issue Jan 7, 2021 · 7 comments
Closed

Bug: Arrays and Dates stopped displaying correctly #80

flybayer opened this issue Jan 7, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@flybayer
Copy link

flybayer commented Jan 7, 2021

Describe the bug

After upgrading from 2.9.1 to 3.0.5, there is a regression in array and date logging.

Before:

2021-01-07 22:21:30.784.000	 DEBUG 	[test.js:5]
{
  createdAt: 2021-01-07T22:21:30.782Z,
  students: [
    {
      id: 1
    },
    {
      id: 2
    }
  ]
}

After:

Notice how Date is now Date {} instead of a string and that array has object syntax.

2021-01-07 22:20:31.495  DEBUG [test.js:5 Object.<anonymous>]
{
  createdAt: Date {},
  students: Array {
    '0': {
      id: 1
    },
    '1': {
      id: 2
    },
    length: 2
  }
}

Also, sometimes I'm seeing [Circular] in place of a Date, but not sure how to reproduce that.

To Reproduce

Run this with 2.9.1 and 3.0.5

var tslog = require("tslog")

const log = new tslog.Logger()

log.debug({
  createdAt: new Date(),
  students: [{ id: 1 }, { id: 2 }],
})

Expected behavior

Same as 2.9.1

Env

System:
OS: macOS 11.1
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 1.44 GB / 64.00 GB
Shell: 3.1.2 - /usr/local/bin/fish

@flybayer flybayer added the bug Something isn't working label Jan 7, 2021
@terehov
Copy link
Contributor

terehov commented Jan 8, 2021

Thank you very much once again for your valuable input. I really feel how with your help the library becomes better and better :-)

@terehov
Copy link
Contributor

terehov commented Jan 8, 2021

I have fixed this issue, need to update tests, and going to release a new version today.

@flybayer
Copy link
Author

flybayer commented Jan 8, 2021

Awesome thanks :)

Another issue I have is tslog with pretty formatting shows up blank in Sentry Breadcrumb logging. But I don't know if that's an issue with Sentry or tslog. I've turned off pretty logging for now in prod.

@terehov
Copy link
Contributor

terehov commented Jan 9, 2021

I am super sorry, got caught up with work. I'll release it soon.
How do you integrate Sentry? Would be great if you could create a new issue for that.
The way I do it is with a JSON transport.

@flybayer
Copy link
Author

flybayer commented Jan 9, 2021

No worries and will do.

terehov added a commit that referenced this issue Jan 20, 2021
@terehov
Copy link
Contributor

terehov commented Jan 20, 2021

Super sorry that it took me so long this time.
I have just released a new version also targeting this issue:

https://github.com/fullstack-build/tslog/releases/tag/v3.1.0

@terehov terehov closed this as completed Jan 20, 2021
@flybayer
Copy link
Author

No problem, thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants