lib/semantic_logger/appender/base.rb in semantic_logger-2.4.1 vs lib/semantic_logger/appender/base.rb in semantic_logger-2.5.0
- old
+ new
@@ -38,11 +38,11 @@
message << " -- " << log.payload.inspect if log.payload
message << " -- " << "#{log.exception.class}: #{log.exception.message}\n#{(log.exception.backtrace || []).join("\n")}" if log.exception
duration_str = log.duration ? "(#{'%.1f' % log.duration}ms) " : ''
- "#{SemanticLogger::Appender::Base.formatted_time(log.time)} #{log.level.to_s[0..0].upcase} [#{$$}:#{log.thread_name}] #{tags}#{duration_str}#{log.name} -- #{message}"
+ "#{SemanticLogger::Appender::Base.formatted_time(log.time)} #{log.level.to_s[0..0].upcase} [#{$$}:#{'%.30s' % log.thread_name}] #{tags}#{duration_str}#{log.name} -- #{message}"
end
end
# Optional log formatter to colorize log output
# To use this formatter
@@ -71,10 +71,10 @@
colors::BOLD
when :error, :fatal
colors::RED
end
- "#{SemanticLogger::Appender::Base.formatted_time(log.time)} #{level_color}#{colors::BOLD}#{log.level.to_s[0..0].upcase}#{colors::CLEAR} [#{$$}:#{log.thread_name}] #{tags}#{duration_str}#{level_color}#{log.name}#{colors::CLEAR} -- #{message}"
+ "#{SemanticLogger::Appender::Base.formatted_time(log.time)} #{level_color}#{colors::BOLD}#{log.level.to_s[0..0].upcase}#{colors::CLEAR} [#{$$}:#{'%.30s' % log.thread_name}] #{tags}#{duration_str}#{level_color}#{log.name}#{colors::CLEAR} -- #{message}"
end
end
############################################################################
protected
\ No newline at end of file