-
Notifications
You must be signed in to change notification settings - Fork 847
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 shortcut methods to log different levels of log records in Logger
#3825
Comments
@pichlermarc If I get the go-ahead, I can send a PR for this. |
The Logs Bridge API is not intended for consumption directly by end-users, only for use with instrumentations for existing logging APIs. The helpers proposed here would have to be added to the spec first. |
What about the |
Hmm, I would also not consider this something that would fit into the scope of the
In the case of log appenders, which is the intended use-case for the logs bridge API, I would not expect So keeping the intended use in mind, I would say adding a helper like this would not be helpful in that case. 🤔 |
Is it not recommended to use opentelemetry logging without 3rd party logging libraries? |
This is correct. Defining an end-user-focused API would be up to the specification. Still, the current plan for the Logs Bridge API is that it is intended only for use within appenders for 3rd party libraries. |
@pichlermarc Would you be willing to accept a |
@pksunkara unfortunately, no. A user-focused logging API in a future spec version is possible - we wouldn't want to provide a competing implementation. The reasoning for accepting #3250 and #3827 and not this request is that:
A better way would be to enable users to use an existing logging framework by implementing any of these issues over at the contrib repository:
With the approach proposed by these issues, users can use existing logging frameworks (and all their features), which is following the spec section that I cited previously in #3825 (comment). |
As per my previous comment, I'm closing this issue as not planned. Once there is a specification for it we can pick up the discussion again in a new issue. |
Is your feature request related to a problem? Please describe.
Right now,
Logger
provides onlyemit
method according to the spec. But it still needs the end-user to importSeverityNumber
and decide onseverityText
before logging. While, this is nice for complex use-cases, this is too convoluted for simple use cases.Describe the solution you'd like
I propose improving the ergonomics of the logging library by adding helper methods for each level. For example:
NOTE: These are strictly helper methods in the
sdk-logs
library and are not considered part of the OpenTelemetry spec.Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: