Class: OpenCensus::Stats::Exporters::Logger
- Inherits:
-
Object
- Object
- OpenCensus::Stats::Exporters::Logger
- Defined in:
- lib/opencensus/stats/exporters/logger.rb
Overview
The Logger exporter exports captured stats view data to a standard Ruby Logger interface.
Instance Method Summary collapse
-
#export(views_data) ⇒ Object
Export the captured stats 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
23 24 25 26 |
# File 'lib/opencensus/stats/exporters/logger.rb', line 23 def initialize logger, level: ::Logger::INFO @logger = logger @level = level end |
Instance Method Details
#export(views_data) ⇒ Object
Export the captured stats to the configured logger.
33 34 35 36 37 |
# File 'lib/opencensus/stats/exporters/logger.rb', line 33 def export views_data stats_data = views_data.map { |vd| format_view_data(vd) } @logger.log @level, stats_data.to_json nil end |