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 Also known as: add
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rawk_log/patch_logger.rb', line 28 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. = "#{}\n" unless [-1,1] == "\n" if !~ /\(pid\:/ .gsub(/(\S.)$/, "\\1 (pid:#{$$})") else end end end |