Class: UzuUzu::Logger::Appengine
- Defined in:
- lib/uzuuzu-core/logger/appengine.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
Instance Method Summary collapse
-
#initialize(env = nil) ⇒ Appengine
constructor
A new instance of Appengine.
- #method_missing(action, *args) ⇒ Object
Constructor Details
#initialize(env = nil) ⇒ Appengine
Returns a new instance of Appengine.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/uzuuzu-core/logger/appengine.rb', line 13 def initialize(env=nil) @adapter = :appengine @logger = AppEngine::Logger.new level = env['level'] || :debug case(level.to_sym) when :info @logger.level = ::Logger::Severity::INFO when :warn @logger.level = ::Logger::Severity::WARN when :error @logger.level = ::Logger::Severity::ERROR when :fatal @logger.level = ::Logger::Severity::FATAL when :unknown @logger.level = ::Logger::Severity::UNKNOWN else @logger.level = ::Logger::Severity::DEBUG end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(action, *args) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/uzuuzu-core/logger/appengine.rb', line 35 def method_missing(action, *args) begin args.each do || = .to_str if .respond_to?(:to_str) = .inspect unless .instance_of?(String) @logger.send(action, ) end rescue => e # puts standerd error output $stderr.puts 'logger unknown error' $stderr.puts e end end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
9 10 11 |
# File 'lib/uzuuzu-core/logger/appengine.rb', line 9 def adapter @adapter end |