Class: TxCatcher::Logger
- Inherits:
-
Object
- Object
- TxCatcher::Logger
- Defined in:
- lib/txcatcher/logger.rb
Constant Summary collapse
- LOG_LEVELS =
{ info: 1, warn: 2, error: 3, fatal: 4, unknown: 5 }
Class Method Summary collapse
Class Method Details
.report(message, log_level = :info, data: nil, timestamp: false) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/txcatcher/logger.rb', line 15 def report(, log_level=:info, data: nil, timestamp: false) [:logfile, :stdout, :sentry].each do |out| if LOG_LEVELS[log_level] >= LOG_LEVELS[Config["logger"]["#{out}_level"].to_sym] send("report_to_#{out}", , log_level, data: data, timestamp: ) end end end |