-
Notifications
You must be signed in to change notification settings - Fork 774
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
Replace print
with log messages.
#1447
Replace print
with log messages.
#1447
Conversation
* Add `slf4j` compile time dependency to the `javaagent-exporters.logging` module * Replace `System.out.println` with log.debug messages Fixes: open-telemetry#1328
be44e52
to
069397e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help!
...ters/logging/src/main/java/io/opentelemetry/javaagent/exporters/logging/LoggingExporter.java
Outdated
Show resolved
Hide resolved
...ters/logging/src/main/java/io/opentelemetry/javaagent/exporters/logging/LoggingExporter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What Anuraag said
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
Updated with suggestions from @anuraaga |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Replace
print
with log messages.slf4j
compile time dependency to thejavaagent-exporters.logging
moduleSystem.out.print
withlog.debug
messagesConcerns:
log.debug
. I can replace it if you think that it should be in other level.AttributeKey
ls logged usingtoString()
method from its implementation. The only implementation right now isAutoValue_AttributeKeyImpl
which prints the key like"AttributeKeyImpl{getType=" + this.getType + ", key=" + this.key + "}"
. I think it is not a good idea to usetoString
from objects for logging because anyone can change the method's implementation or provide implementation withouttoString
(with default) and it will affect logging quality. I would change it not rely ontoString
output, but I don't know what would the appropriate format for this. If you have ideas please share.Fixes: #1328