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

Doesn't look like expected, at least inside workers threads #121

Open
rubenOrtz opened this issue Dec 17, 2022 · 2 comments
Open

Doesn't look like expected, at least inside workers threads #121

rubenOrtz opened this issue Dec 17, 2022 · 2 comments

Comments

@rubenOrtz
Copy link

Describe the bug
When i use a extended class for Signale
export default class Logger extends Signale { constructor(config: any, client?: any) { super({ config, logLevel: 'info', types: { startUp: { badge: '✔', color: 'green', label: 'Inicio', logLevel: 'info', }, log: { badge: '👍', color: 'white', label: 'Info', logLevel: 'info', }
It works fine, when i call the class from a normal file inside my project (for example, the manager, as you see in the image)
const logger = new Logger({ displayTimestamp: true, displayDate: true, });
But when i call the exact same Logger, as the manager, but inside a cluster using Node.js worker threads didnt look as good as it looks in the manager (check the image)

To Reproduce
Create a worker thread
create a file with a extended Signale as above
create a logger inside and outside the worker and call both, you will see the difference

Technical Info (please complete the following information)

  • OS: Ubuntu 22.04 (Windows WSL)
  • Signale Version: 1.4.0
  • Node.js Version: v19.0.1

image

@rubenOrtz rubenOrtz changed the title Doesn't loo like expected, at least inside clusters Doesn't look like expected, at least inside clusters Dec 17, 2022
@rubenOrtz rubenOrtz changed the title Doesn't look like expected, at least inside clusters Doesn't look like expected, at least inside workers threads Dec 17, 2022
@GRVYDEV
Copy link

GRVYDEV commented Feb 1, 2023

Yeah Im running into the same issue. Im wondering if it has something to do with nodejs/node#26946

@GRVYDEV
Copy link

GRVYDEV commented Feb 1, 2023

Looks like its an issue in the underlying color library chalk. See chalk/chalk#327

I was able to fix it by adding

process.env['FORCE_COLOR'] = '3';

At the top of the file where the workers are spawned

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