Exception: EventLoggerRails::Exceptions::InvalidLoggerLevel
- Inherits:
-
StandardError
- Object
- StandardError
- EventLoggerRails::Exceptions::InvalidLoggerLevel
- Defined in:
- lib/event_logger_rails/exceptions/invalid_logger_level.rb
Overview
Indicates invalid log level provided.
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Instance Method Summary collapse
-
#initialize(logger_level:) ⇒ InvalidLoggerLevel
constructor
Initializes the exception with the given logger level.
-
#message ⇒ String
Provides an informative error message.
Constructor Details
#initialize(logger_level:) ⇒ InvalidLoggerLevel
Initializes the exception with the given logger level.
12 13 14 15 16 |
# File 'lib/event_logger_rails/exceptions/invalid_logger_level.rb', line 12 def initialize(logger_level:) super @event = Event.new('event_logger_rails.logger_level.invalid') @logger_level = logger_level end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
9 10 11 |
# File 'lib/event_logger_rails/exceptions/invalid_logger_level.rb', line 9 def event @event end |
Instance Method Details
#message ⇒ String
Provides an informative error message.
21 22 23 24 |
# File 'lib/event_logger_rails/exceptions/invalid_logger_level.rb', line 21 def "Invalid logger level provided: '#{logger_level.to_sym}'. " \ 'Valid levels: :debug, :info, :warn, :error, :unknown.' end |