Class: OpenCensus::Trace::Exporters::Logger
- Inherits:
-
Object
- Object
- OpenCensus::Trace::Exporters::Logger
- Defined in:
- lib/opencensus/trace/exporters/logger.rb
Overview
The Logger exporter exports captured spans to a standard Ruby Logger interface.
Instance Method Summary collapse
-
#export(spans) ⇒ Object
Export the captured spans to the configured logger.
-
#initialize(logger, level: ::Logger::INFO) ⇒ Logger
constructor
Create a new Logger exporter.
Constructor Details
#initialize(logger, level: ::Logger::INFO) ⇒ Logger
Create a new Logger exporter
35 36 37 38 |
# File 'lib/opencensus/trace/exporters/logger.rb', line 35 def initialize logger, level: ::Logger::INFO @logger = logger @level = level end |
Instance Method Details
#export(spans) ⇒ Object
Export the captured spans to the configured logger.
45 46 47 48 |
# File 'lib/opencensus/trace/exporters/logger.rb', line 45 def export spans @logger.log @level, spans.map { |span| format_span(span) }.to_json nil end |