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/log.rb
Constant Summary collapse
- @@logger =
nil
Instance Method Summary collapse
Instance Method Details
#log ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vines/log.rb', line 6 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-%d %H:%M:%S".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 |