Module: WatchList::Logger::Helper
- Included in:
- Driver
- Defined in:
- lib/watch_list/logger.rb
Instance Method Summary collapse
Instance Method Details
#log(level, message, opts = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/watch_list/logger.rb', line 19 def log(level, , opts = {}) opts = (@options || {}).merge(opts) = "[#{level.to_s.upcase}] #{}" unless level == :info << ' (dry-run)' if opts[:dry_run] = .send(opts[:color]) if opts[:color] logger = opts[:logger] || WatchList::Logger.instance logger.send(level, ) end |