Class: ActiveSupport::BufferedLogger
- Inherits:
-
Object
- Object
- ActiveSupport::BufferedLogger
- Defined in:
- lib/rawk_log/patch_logger.rb
Instance Method Summary collapse
Instance Method Details
#add_with_pid(severity, message = nil, progname = nil, &block) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rawk_log/patch_logger.rb', line 25 def add_with_pid(severity, = nil, progname = nil, &block) add_without_pid(severity) do = ( || (block && block.call) || progname).to_s # If a newline is necessary then create a new message ending with a newline. # Ensures that the original message is not mutated. = "#{message}\n" unless [-1] == ?\n if !~ /^\n*$/ && !~ /\(pid\:/ .gsub(/\n/," (pid:#{$$})\n") else end end end |