-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEBUG-3210 DI: change logging to be appropriate for customer inspection
Failure to enable DI is now a warning (since enabling it must have been requested by the customer). Remaining logging calls are now emitted at debug level by default, making those entries not visible in customer logs. An internal DI setting is added to reinstate logging of internal issues at warn level, for developing/debugging DI.
- Loading branch information
Showing
11 changed files
with
83 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# frozen_string_literal: true | ||
|
||
module Datadog | ||
module DI | ||
# Logging for DI | ||
module Logging | ||
# Logs an internal warning message. | ||
# When verbose logging is enabled, the logging happens at warn level. | ||
# When verbose logging is disabled, the logging happens at debug level | ||
# (which is how the rest of the library is reporting its internal | ||
# warnings/errors). | ||
def log_warn_internal(msg) | ||
if settings.dynamic_instrumentation.internal.verbose_logging | ||
logger.warn(msg) | ||
else | ||
logger.debug(msg) | ||
end | ||
end | ||
|
||
# Logs an internal informational message. | ||
# When verbose logging is enabled, the logging happens at info level. | ||
# When verbose logging is disabled, nothing is logged. | ||
def log_info_internal(msg) | ||
if settings.dynamic_instrumentation.internal.verbose_logging | ||
logger.info(msg) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters