Sha256: fc2a0b8224897f643f56c63da8831acc24c827356ce15e408be65328abbc2e19
Contents?: true
Size: 707 Bytes
Versions: 15
Compression:
Stored size: 707 Bytes
Contents
# -*- coding: binary -*- module Rex module Logging module Sinks ### # # This class implements the LogSink interface and backs it against stderr ### class Stderr include Rex::Logging::LogSink # # Writes log data to stderr # def log(sev, src, level, msg, from) # :nodoc: if (sev == LOG_RAW) $stderr.write(msg) else code = 'i' case sev when LOG_DEBUG code = 'd' when LOG_ERROR code = 'e' when LOG_INFO code = 'i' when LOG_WARN code = 'w' end $stderr.write("[#{get_current_timestamp}] [#{code}(#{level})] #{src}: #{msg}\n") end $stderr.flush end protected end end end end
Version data entries
15 entries across 15 versions & 3 rubygems