Class: JRuby::Rack::GrizzlyLog

Inherits:
Object
  • Object
show all
Defined in:
lib/jruby/rack/grizzly_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger = $logger) ⇒ GrizzlyLog

Returns a new instance of GrizzlyLog.



127
128
129
# File 'lib/jruby/rack/grizzly_helper.rb', line 127

def initialize(logger = $logger)
  @logger = logger
end

Instance Method Details

#closeObject



144
# File 'lib/jruby/rack/grizzly_helper.rb', line 144

def close; end

#flushObject



143
# File 'lib/jruby/rack/grizzly_helper.rb', line 143

def flush; end

#puts(msg) ⇒ Object



130
131
132
# File 'lib/jruby/rack/grizzly_helper.rb', line 130

def puts(msg)
  write msg.to_s
end

#write(msg) ⇒ Object



134
135
136
137
138
139
140
141
# File 'lib/jruby/rack/grizzly_helper.rb', line 134

def write(msg)
  case $gf_ruby_log_level
    when 3,4,5 then @logger.severe("#{msg}")
    when 2 then @logger.warning("#{msg}")
    when 0,1 then @logger.info("#{msg}")
    else @logger.info("#{msg}") 
  end
end