Class: Datadog::SymbolDatabase::Logger Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/datadog/symbol_database/logger.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Logger facade that adds a config-gated trace method.

Wraps any logger (customer-provided or default) and delegates standard methods. The trace method is a sub-debug level that is a no-op unless DD_TRACE_DEBUG is set, avoiding overhead for high-frequency log sites (per-module filtering, dedup checks).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings, target) ⇒ Logger

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Logger.

Parameters:

  • settings (Configuration::Settings)

    Tracer settings (reads trace_logging flag)

  • target (::Logger)

    Underlying logger to delegate to



20
21
22
23
# File 'lib/datadog/symbol_database/logger.rb', line 20

def initialize(settings, target)
  @settings = settings
  @target = target
end

Instance Attribute Details

#settingsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
# File 'lib/datadog/symbol_database/logger.rb', line 25

def settings
  @settings
end

Instance Method Details

#trace { ... } ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Log at trace level (sub-debug). No-op unless DD_TRACE_DEBUG is set.

Yields:

  • Block that returns the log message string



36
37
38
39
40
# File 'lib/datadog/symbol_database/logger.rb', line 36

def trace(&block)
  if settings.symbol_database.internal.trace_logging
    debug(&block)
  end
end