Module: IuguLogger
- Defined in:
- lib/iugu_logger.rb,
lib/iugu_logger/pii.rb,
lib/iugu_logger/buffer.rb,
lib/iugu_logger/logger.rb,
lib/iugu_logger/schema.rb,
lib/iugu_logger/railtie.rb,
lib/iugu_logger/version.rb,
lib/iugu_logger/severity.rb,
lib/iugu_logger/job_logger.rb,
lib/iugu_logger/smoke_test.rb,
lib/iugu_logger/configuration.rb,
lib/iugu_logger/trace_context.rb,
lib/iugu_logger/request_logger.rb,
lib/iugu_logger/tenant_context.rb,
lib/generators/iugu_logger/install/install_generator.rb
Overview
Loaded conditionally from lib/iugu_logger.rb only when ::Rails::Railtie is defined (i.e. Rails is on the load path). Apps without Rails ignore this file.
Defined Under Namespace
Modules: Generators, JobLogger, Pii, Schema, Severity, SmokeTest, TenantContext, TraceContext Classes: Buffer, Configuration, ConfigurationError, Error, Logger, Railtie, RequestLogger, SchemaViolation, UnknownEventAction
Constant Summary collapse
- VERSION =
'0.10.0'
Class Method Summary collapse
- .configuration ⇒ Object
-
.configure {|configuration| ... } ⇒ Object
Yields the configuration object for setup.
-
.event(action, **fields) ⇒ Object
Convenience proxy to logger.event(…).
-
.logger ⇒ Object
The shared singleton logger.
-
.reset! ⇒ Object
Resets configuration and logger.
Class Method Details
.configuration ⇒ Object
48 49 50 |
# File 'lib/iugu_logger.rb', line 48 def configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
Yields the configuration object for setup.
43 44 45 46 |
# File 'lib/iugu_logger.rb', line 43 def configure yield(configuration) if block_given? configuration end |
.event(action, **fields) ⇒ Object
Convenience proxy to logger.event(…).
58 59 60 |
# File 'lib/iugu_logger.rb', line 58 def event(action, **fields) logger.event(action, **fields) end |
.logger ⇒ Object
The shared singleton logger. Lazy-instantiated.
53 54 55 |
# File 'lib/iugu_logger.rb', line 53 def logger @logger ||= Logger.new(configuration) end |
.reset! ⇒ Object
Resets configuration and logger. For tests / repl only.
63 64 65 66 |
# File 'lib/iugu_logger.rb', line 63 def reset! @configuration = nil @logger = nil end |