Module: Gratan::Logger::Helper
- Included in:
- DSL::Context, Driver, Identifier::CSV
- Defined in:
- lib/gratan/logger.rb
Instance Method Summary collapse
Instance Method Details
#log(level, message, options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/gratan/logger.rb', line 19 def log(level, , = {}) = || {} = "[#{level.to_s.upcase}] #{message}" unless level == :info if [:dry_run] and [:dry_run] != false << ' (dry-run)' if [:dry_run] end = .send([:color]) if [:color] logger = [:logger] || Gratan::Logger.instance logger.send(level, ) end |