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

Profiler.done doesn't respect defaultMeta. #1665

Closed
1 of 2 tasks
q42jaap opened this issue Jul 1, 2019 · 7 comments
Closed
1 of 2 tasks

Profiler.done doesn't respect defaultMeta. #1665

q42jaap opened this issue Jul 1, 2019 · 7 comments
Assignees
Labels
Metadata Applies to Metadata behavior Profiling Applies to Profiling behavior

Comments

@q42jaap
Copy link

q42jaap commented Jul 1, 2019

Please tell us about your environment:

  • winston version?
    • winston@2
    • winston@3.2.1
  • node -v outputs:
    v8.10.0
  • Operating System? (Windows, macOS, or Linux)
    Linux
  • Language? (all | TypeScript X.X | ES6/7 | ES5 | Dart)
    all

What is the problem?

The following code:

const winston = require('winston');

const logger = winston.createLogger({
  defaultMeta: {metaProp: 'metaValue'},
  transports: [
    new winston.transports.Console(),
  ],
});

logger.info('with meta');

const timer = logger.startTimer();
timer.done({message: 'without meta'});

Logs this to the console:

{"message":"with meta","level":"info","prop":"value"}
{"message":"without meta","level":"info","durationMs":1}

What do you expect to happen instead?

I would expect the Profiler.done function to add the defaultMeta to the log entry.

@wlopez-enkoding
Copy link

Were you able to solve the problem?

@q42jaap
Copy link
Author

q42jaap commented Feb 21, 2020

We never solved it.

@wlopez-enkoding
Copy link

We never solved it.

I noticed that this information is only printed out when the type of the output is error. It's not displayed when are just info.

@linqFR
Copy link

linqFR commented Nov 22, 2020

I noticed same issue on winston@3.3.3

@maverick1872
Copy link
Member

Closing as this issue is being consolidated into #2029

@wvhulle
Copy link

wvhulle commented Jan 23, 2023

This still seems to be an issue.

@wbt
Copy link
Contributor

wbt commented Jan 25, 2023

Is it an issue in v3.7.1? The fixes for the consolidated issue got reverted after that as they inadvertently broke some things, and neither @maverick1872 nor anyone else has gotten around to fixing that breakage yet as far as I'm aware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metadata Applies to Metadata behavior Profiling Applies to Profiling behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants