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

Add Warn internal logging function #3866

Closed
pellared opened this issue Mar 13, 2023 · 3 comments · Fixed by #3900
Closed

Add Warn internal logging function #3866

pellared opened this issue Mar 13, 2023 · 3 comments · Fixed by #3900
Labels
enhancement New feature or request
Milestone

Comments

@pellared
Copy link
Member

pellared commented Mar 13, 2023

Ended up not creating a Warn function as mentioned in the issue since Info is already being used for warning messages in other places.

Originally from #3854

We should consider adding Warn logging function to go.opentelemetry.io/otel/internal/global.

@unicod3
Copy link
Contributor

unicod3 commented Mar 13, 2023

I can work on this one but have a question, Is there any agreed verbosity level for the Warn?

As far as I see we currently have Debug (v-level: 5) and Info (v-level: 1), Ideally verbosity level of warn should be lower than info since it is meant to be more important than info.

One approach could be changing the verbosity level of info close to debug, but I am not sure about implications of it.

@pellared pellared added the enhancement New feature or request label Mar 14, 2023
@MrAlias
Copy link
Contributor

MrAlias commented Mar 16, 2023

I can work on this one but have a question, Is there any agreed verbosity level for the Warn?

As far as I see we currently have Debug (v-level: 5) and Info (v-level: 1), Ideally verbosity level of warn should be lower than info since it is meant to be more important than info.

One approach could be changing the verbosity level of info close to debug, but I am not sure about implications of it.

Can we map to a pseudo inverse of what the OTel logging spec is: https://github.com/open-telemetry/opentelemetry-specification/blob/c10191c1bf2a6961145f3c5c1b16b89d54af02c0/specification/logs/data-model.md#field-severitynumber

For example:

Name LogR Severity OTel Severity
Error 0 17-24
Warn 1 13-16
Info 4 9-12
Debug 8 5-8

@MadVikingGod
Copy link
Contributor

The reason that the original values were chosen was to somewhat match expectations of current uses of logr.

Most uses of logr on github, only even use level 0. A few will use level 1 with a -v flag. And there were one or two uses of 5 for debug-level logging.

@XSAM XSAM added this to the untracked milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants