Sha256: f414e73507a7e95b14e3d187f12153da06387a208d36fc9f81e6502e79c8ea3e
Contents?: true
Size: 630 Bytes
Versions: 2
Compression:
Stored size: 630 Bytes
Contents
module BmcDaemonLib class LoggerFormatter def self.call severity, datetime, progname, payload # Build common values timestamp = datetime.strftime(LOG_HEADER_TIME) # Build header header = sprintf LOG_HEADER_FORMAT, timestamp, Process.pid, severity, progname # If we have a bunch of lines, prefix them and send them together return payload.map do |line| "#{header}#{trimmed(line)}\n" end.join if payload.is_a?(Array) # Otherwise, just prefix the only line return "#{header}#{trimmed(payload)}\n" end protected end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bmc-daemon-lib-0.4.1 | lib/bmc-daemon-lib/logger_formatter.rb |
bmc-daemon-lib-0.4.0 | lib/bmc-daemon-lib/logger_formatter.rb |