Class: Path::Reporting::Analytics::Console
- Inherits:
-
Object
- Object
- Path::Reporting::Analytics::Console
- Defined in:
- lib/path/reporting/analytics/console.rb
Overview
Simple non-structure console logging for analytics data. Most helpful for development or backup rather than analysis.
Instance Method Summary collapse
-
#initialize(config) ⇒ Console
constructor
Create new console logging analytics reporter.
-
#record(name:, user:, user_type:, trigger:, metadata: {}) ⇒ Object
Log the analytics event to the configured logger.
Constructor Details
#initialize(config) ⇒ Console
Create new console logging analytics reporter
12 13 14 |
# File 'lib/path/reporting/analytics/console.rb', line 12 def initialize(config) @config = config.analytics end |
Instance Method Details
#record(name:, user:, user_type:, trigger:, metadata: {}) ⇒ Object
Log the analytics event to the configured logger
23 24 25 |
# File 'lib/path/reporting/analytics/console.rb', line 23 def record(name:, user:, user_type:, trigger:, metadata: {}) @config.logger.info("[#{trigger}]:#{name} - #{user.inspect} (#{user_type}) #{.nil? ? "" : .inspect}") end |