lib/legion/logging/methods.rb in legion-logging-1.1.2 vs lib/legion/logging/methods.rb in legion-logging-1.1.3

- old
+ new

@@ -1,9 +1,9 @@ module Legion module Logging module Methods - def trace(raw_message = nil, log = @log, size: @trace_size, log_caller: true) # rubocop:disable Metrics/AbcSize + def trace(raw_message = nil, size: @trace_size, log_caller: true) # rubocop:disable Metrics/AbcSize return unless @trace_enabled raw_message = yield if raw_message.nil? && block_given? message = Rainbow('Tracing: ').cyan message.concat Rainbow("#{raw_message} ").cyan @@ -13,50 +13,50 @@ message.concat Rainbow(caller_locations[0..size]).cyan.underline end log.unknown(message) end - def debug(message = nil, log = @log) + def debug(message = nil) return unless log.level < 1 message = yield if message.nil? && block_given? message = Rainbow(message).blue if @color log.debug(message) end - def info(message = nil, log = @log) + def info(message = nil) return unless log.level < 2 message = yield if message.nil? && block_given? message = Rainbow(message).green if @color log.info(message) end - def warn(message = nil, log = @log) + def warn(message = nil) return unless log.level < 3 message = yield if message.nil? && block_given? message = Rainbow(message).yellow if @color log.warn(message) end - def error(message = nil, log = @log) + def error(message = nil) return unless log.level < 4 message = yield if message.nil? && block_given? message = Rainbow(message).red if @color log.error(message) end - def fatal(message = nil, log = @log) + def fatal(message = nil) return unless log.level < 5 message = yield if message.nil? && block_given? message = Rainbow(message).darkred if @color log.fatal(message) end - def unknown(message = nil, log = @log) + def unknown(message = nil) message = yield if message.nil? && block_given? message = Rainbow(message).purple if @color log.unknown(message) end