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

Logger: Support for Instrumentation library #1128

Conversation

esigo
Copy link
Member

@esigo esigo commented Dec 10, 2021

Fixes #1087 (issue)

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@codecov
Copy link

codecov bot commented Dec 10, 2021

Codecov Report

Merging #1128 (0e4df67) into main (f60eec2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1128   +/-   ##
=======================================
  Coverage   93.39%   93.39%           
=======================================
  Files         165      165           
  Lines        6229     6229           
=======================================
  Hits         5817     5817           
  Misses        412      412           

@esigo esigo changed the title [WIP] Logger: Support for Instrumentation library Logger: Support for Instrumentation library Dec 17, 2021
@esigo esigo marked this pull request as ready for review December 17, 2021 13:34
@esigo esigo requested a review from a team December 17, 2021 13:34

virtual nostd::shared_ptr<Logger> GetLogger(nostd::string_view logger_name,
nostd::span<nostd::string_view> args) = 0;
virtual nostd::shared_ptr<Logger> GetLogger(nostd::string_view library_name,
Copy link
Member

@lalitb lalitb Dec 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for not clarifying this in the issue, but I think logger_name and library_name are two separate entities and would be good to support both of them. While LoggerName is still not in the log data model ( in specs ) the PR is open - open-telemetry/opentelemetry-specification#1236 - and hopefully it would get added soon.

Also, do you think we can keep options and args even though they are not used as of now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So logger_name, library_name, options and args. library_name goes to the instrumentation , and options and args will stay unused correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes correct.

@@ -44,19 +46,13 @@ nostd::shared_ptr<logs_api::Logger> LoggerProvider::GetLogger(nostd::string_view

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The search logic also needs changes. Probably storing in the vector instead of map, and comparing for instrumentation_library ( as done in tracer ) along with the logger_name to get the right logger.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 17, 2021

CLA Not Signed

@esigo
Copy link
Member Author

esigo commented Dec 18, 2021

@lalitb Sorry, seems my Windows machine's git is still connected to my old email. I'd prefer to close this one and raise a new PR.

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

Successfully merging this pull request may close these issues.

Logger: Support for Instrumentation library.
3 participants