Module: Vines::Log
- Included in:
- Cluster, Cluster::Publisher, Cluster::Sessions, Cluster::Subscriber, Config::Port, Storage, Stream, Stream::Http::Sessions, Stream::SASL, Stream::State, XmppServer
- Defined in:
- lib/vines.rb,
lib/vines/log.rb
Constant Summary collapse
- @@logger =
nil
Instance Method Summary collapse
Instance Method Details
#log ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/vines.rb', line 38 def log unless @@logger @@logger = Logger.new(STDOUT) @@logger.level = Logger::INFO @@logger.progname = 'vines' @@logger.formatter = Class.new(Logger::Formatter) do def initialize @time = "%Y-%m-%dT%H:%M:%SZ".freeze @fmt = "[%s] %5s -- %s: %s\n".freeze end def call(severity, time, program, msg) @fmt % [time.utc.strftime(@time), severity, program, msg2str(msg)] end end.new end @@logger end |