lib/legion/logging/methods.rb in legion-logging-1.0.0 vs lib/legion/logging/methods.rb in legion-logging-1.1.0

- 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/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize + def trace(raw_message = nil, log = @log, size: @trace_size, log_caller: true) # rubocop:disable Metrics/PerceivedComplexity, 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 @@ -66,10 +66,10 @@ Legion::Logging.error exc.backtrace Legion::Logging.error opts { success: false, message: exc.message, backtrace: exc.backtrace }.merge(opts) end - def thread(kvl: false) + def thread(kvl: false, **_opts) if kvl "thread=#{Thread.current.object_id}" else Thread.current.object_id.to_s end