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
Crash when logging date #72
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
Comments
Would you mind sending a PR?
Il giorno gio 27 giu 2019 alle 15:02 Tiim <notifications@github.com> ha
scritto:
… When i directly log JSON.stringified date with console.log without using
pino then peno-pretty crashes with the following error message:
/code/node_modules/pino-pretty/lib/utils.js:178
if ('level' in log === false) return undefined
^
TypeError: Cannot use 'in' operator to search for 'level' in 2019-05-31T00:00:00.000Z
at prettifyLevel (/code/node_modules/pino-pretty/lib/utils.js:178:15)
at pretty (/code/node_modules/pino-pretty/index.js:85:29)
at Transform.transform [as _transform] (/code/node_modules/pino-pretty/bin.js:38:18)
at Transform._read (/code/node_modules/pino-pretty/node_modules/readable-stream/lib/_stream_transform.js:177:10)
at Transform._write (/code/node_modules/pino-pretty/node_modules/readable-stream/lib/_stream_transform.js:164:83)
at doWrite (/code/node_modules/pino-pretty/node_modules/readable-stream/lib/_stream_writable.js:405:139)
at writeOrBuffer (/code/node_modules/pino-pretty/node_modules/readable-stream/lib/_stream_writable.js:394:5)
at Transform.Writable.write (/code/node_modules/pino-pretty/node_modules/readable-stream/lib/_stream_writable.js:303:11)
at Transform.ondata (/code/node_modules/split2/node_modules/readable-stream/lib/_stream_readable.js:662:20)
at Transform.emit (events.js:196:13)
The following snipped in my code (fastify server) will produde this crash:
const value = JSON.stringify(new Date());
console.log(value);
I have not tested if this only works with stringified dates or if this is
a bug when a string with start and end "quotes" gets logged.
I know this is already my second crash report, but apparently I'm a talent
for finding crash bugs in pino-pretty 😅
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#72?email_source=notifications&email_token=AAAMXY7GNMZAV4AUOEIPDOLP4S26VA5CNFSM4H33XWHKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G4CF3MA>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAMXY5O7WDAB7IIC2YLS2DP4S26VANCNFSM4H33XWHA>
.
|
A plain string is valid JSON, thus it gets past the check: Lines 56 to 65 in a6b2032
Probably need another Lines 68 to 70 in a6b2032
|
jsumners
added
bug
Something isn't working
help wanted
Extra attention is needed
good first issue
Good for newcomers
labels
Jul 2, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
When i directly log JSON.stringified date with console.log without using pino then peno-pretty crashes with the following error message:
The following snipped in my code (fastify server) will produde this crash:
I have not tested if this only works with stringified dates or if this is a bug when a string with start and end "quotes" gets logged.
I know this is already my second crash report, but apparently I'm a talent for finding crash bugs in pino-pretty 😅
The text was updated successfully, but these errors were encountered: