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

[Bug]: When calling logger.data(), an 'undefined' is mysteriously added to the log output #2053

Closed
MatrixFrog opened this issue Feb 1, 2022 · 2 comments · Fixed by winstonjs/logform#135

Comments

@MatrixFrog
Copy link

The problem

I wrote a little test that demonstrates this: MatrixFrog@cb9ef9b The call to log.data() should be emitting '\x1B[90mdata\x1B[39m:test message\n' but instead we get '\x1B[90mdata\x1B[39m:undefinedtest message\n'

From what I can tell, the 'undefined' is coming from here: https://github.com/winstonjs/logform/blob/master/pad-levels.js#L64 though I'm not sure exactly why.

What version of Winston presents the issue?

3.5.1

What version of Node are you using?

14.17.6

If this worked in a previous version of Winston, which was it?

No response

Minimum Working Example

https://github.com/MatrixFrog/winston/commit/cb9ef9b09510aae9dbb6caf3bb697014aced5f68

Additional information

No response

@MatrixFrog
Copy link
Author

I think I found a fix, looks like maybe just a little copy/paste error: winstonjs/logform#135

@DABH
Copy link
Contributor

DABH commented Feb 1, 2022

Thanks, reviewed!

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

Successfully merging a pull request may close this issue.

2 participants