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

Incorrect logging of nested objects and dates #394

Closed
madmurl0c opened this issue Jan 9, 2024 · 2 comments
Closed

Incorrect logging of nested objects and dates #394

madmurl0c opened this issue Jan 9, 2024 · 2 comments

Comments

@madmurl0c
Copy link

I recently noticed that some outputs in my logs seemed odd, it seems like some values don't get logged correctly.
To be more precise I noticed that JS Dates get logged as {} and a boolean values (when inside an object) as '[boolean]'

Example:

This is what it looks like in the DevTools:
image

This is what gets logged:

[2024-01-09 14:37:47.833+01:00] [info]  [renderer] {}
[2024-01-09 14:37:53.705+01:00] [info]  [renderer] { bool: true }
[2024-01-09 14:38:01.817+01:00] [info]  [renderer] { nested: { obj: { bool: '[boolean]' } } }

Configuration:

main:

...
log.initialize({ preload: true });
log.transports.file.format = '[{y}-{m}-{d} {h}:{i}:{s}.{ms}{z}] [{level}] [{processType}]{scope} {text}';
log.transports.file.level = 'debug';
...

renderer.ts:

import log from 'electron-log/renderer';
...
console.log = log.log

electron-log version: 5.0.3

Did is misconfigure something or is this a bug?

@megahertz
Copy link
Owner

Thanks for the report. I'll investigate that this week.

@megahertz
Copy link
Owner

Fixed in electron-log@5.1.0-beta.2

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

No branches or pull requests

2 participants