Class: PrettyFormatter::Formatter
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- PrettyFormatter::Formatter
- Defined in:
- lib/pretty_formatter.rb
Constant Summary collapse
- @@severity_cache =
{}
- @@pid =
$$
- @@color =
ActiveSupport::LogSubscriber.colorize_logging
- @@hostname =
get_hostname
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.get_hostname ⇒ Object
33 34 35 |
# File 'lib/pretty_formatter.rb', line 33 def self.get_hostname `hostname -s`.strip end |
Instance Method Details
#call(severity, timestamp, progname, msg) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/pretty_formatter.rb', line 20 def call(severity, , progname, msg) = String === msg ? msg : msg.inspect = '' unless (.start_with?('Started GET "/assets') || !.present?) && ::PrettyFormatter.suppress_noise prefix, time = ::PrettyFormatter.verbose ? [prefix_string, "#{Time.now.iso8601(5)} "] : ['', ''] = "#{prefix}#{time}#{severity_color(severity)} #{}\n" end end |