tslog icon indicating copy to clipboard operation
tslog copied to clipboard

Bug: JSON type returning hostname and instance name when supposed to be hidden by default

Open blakejoy opened this issue 3 years ago • 2 comments

Describe the bug The json type is returning the full logObject regardless of the values provided to be hidden/displayed in the settings.

To Reproduce Steps to reproduce the behavior:

  1. Create new Logger with settings param {type: 'json'}
  2. Pass a string to Logger instance to see the output.

Expected behavior The log output when formatted as json should not display the values that are supposed to be hidden by default. Ie. hostname, instancename.

Node.js Version 14.16.0

OS incl. Version macOS 10.15.7

blakejoy avatar Jun 15 '21 16:06 blakejoy

@blakejoy Please, did you get a way around this?

hydeenoble avatar Jul 29 '21 08:07 hydeenoble

I ended up not using this @hydeenoble 🥲

blakejoy avatar Jul 29 '21 12:07 blakejoy

There is a new, completely rewritten version (4.0) which handles it completely different and should solve this out of the box. In addition, you can also overwrite every step of the log process. Give it a go and let me know if that solves your problem:

  • npm i tslog@next

  • and run it with node --enable-source-maps or for TypeScript node --enable-source-maps --experimental-specifier-resolution=node --no-warnings --loader ts-node/esm

Thanks.

terehov avatar Sep 30 '22 12:09 terehov

V4 is released now, so I'm going to close this issue. Feel free to open a new one if V4 didn't solve it for you.

Here are the docs: tslog.js.org

terehov avatar Nov 15 '22 18:11 terehov