Module: ContextLogger
- Defined in:
- lib/context_logger.rb,
lib/context_logger/engine.rb
Defined Under Namespace
Classes: Engine
Constant Summary collapse
- SEVERITY_TYPES =
:unknown
[:info, :warn, :error, :debug, :fatal, #:unknown ]
- DEFAULTS =
{ context: :context_log, # action_id: nil, # server_name: nil, # method: nil, # params: nil, # message: 'Empty message', # stack_trace: nil }
- ALL_DESTINATIONS =
{ write_rails_log: true, write_context_log: true, write_db_log: true }
Class Method Summary collapse
- .destinations ⇒ Object
- .options ⇒ Object
- .set_destinations(_destinations) ⇒ Object
- .setup(options) ⇒ Object
Class Method Details
.destinations ⇒ Object
55 56 57 |
# File 'lib/context_logger.rb', line 55 def self.destinations return @destinations end |
.options ⇒ Object
42 43 44 |
# File 'lib/context_logger.rb', line 42 def self. return @options end |
.set_destinations(_destinations) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/context_logger.rb', line 46 def self.set_destinations(_destinations) if _destinations == :all @destinations = ALL_DESTINATIONS.clone return end @destinations = _destinations.select{|k, v| ALL_DESTINATIONS[k] and v} end |
.setup(options) ⇒ Object
38 39 40 |
# File 'lib/context_logger.rb', line 38 def self.setup() @options = (@options || {}).merge() end |