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 : Info log level has a lower priority than debug #122

Closed
lox opened this issue Sep 29, 2023 · 7 comments
Closed

BUG : Info log level has a lower priority than debug #122

lox opened this issue Sep 29, 2023 · 7 comments
Assignees
Labels
bug Something isn't working open source PRs or issues originating from the open-source community

Comments

@lox
Copy link

lox commented Sep 29, 2023

We are creating our client like this:

    analyticsClient = new RudderAnalytics(process.env.RUDDERSTACK_WRITE_KEY ?? '', {
      dataPlaneUrl: process.env.RUDDERSTACK_DATA_PLANE_URL,
      logLevel: 'info',
      flushAt: 1,
    })

Still seeing log messages like:

[Rudder] debug: flushAt reached, trying flush...
[Rudder] debug: in flush
[Rudder] debug: in flush

We are running: "@rudderstack/rudder-sdk-node": "^2.0.4",

@lox lox added bug Something isn't working open source PRs or issues originating from the open-source community labels Sep 29, 2023
@MoumitaM
Copy link

@lox , Apologies for the delay, I will look into it.

@MoumitaM
Copy link

@lox, Currently in our SDK log level info has a lower priority than debug. So all the higher priority errors along with info will be printed.
Do you think that's the concern?

@lox
Copy link
Author

lox commented Oct 12, 2023

I'm not sure I understand, are you saying that info < debug on your logger levels? If so, that seems very odd. 🤔

@lox
Copy link
Author

lox commented Oct 12, 2023

Oh wow, yeah you are right:

const LOG_LEVEL_MAP = {
log: 0,
info: 1,
debug: 2,
warn: 3,
error: 4,
none: 5,
};

Looks like it was introduced by @bardisg in 3619247 when winston was extracted. I'd hazard a guess that is a mistake / typo, as the more conventional logger levels from winston are:

https://github.com/winstonjs/winston#logging

const levels = {
  error: 0,
  warn: 1,
  info: 2,
  http: 3,
  verbose: 4,
  debug: 5,
  silly: 6
};

@lox lox changed the title BUG : Log levels ignored BUG : Info log level has a lower priority than debug Oct 12, 2023
@lox
Copy link
Author

lox commented Oct 12, 2023

I updated the title to reflect the issue better!

@MoumitaM
Copy link

Thanks, @lox for the clarification. We will fix this.

@MoumitaM
Copy link

@lox, This issue has been fixed and released. Check out 2.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working open source PRs or issues originating from the open-source community
Projects
None yet
Development

No branches or pull requests

2 participants