Class: YuiRestClient::Logger
- Inherits:
-
Object
- Object
- YuiRestClient::Logger
- Extended by:
- Forwardable
- Defined in:
- lib/yui_rest_client/logger.rb
Instance Method Summary collapse
- #create_logger(output) ⇒ Object
- #default_level ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
17 18 19 |
# File 'lib/yui_rest_client/logger.rb', line 17 def initialize @logger = create_logger($stdout) end |
Instance Method Details
#create_logger(output) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/yui_rest_client/logger.rb', line 21 def create_logger(output) logger = ::Logger.new(output) logger.progname = 'YuiRestClient' logger.level = default_level logger end |
#default_level ⇒ Object
28 29 30 |
# File 'lib/yui_rest_client/logger.rb', line 28 def default_level ENV['DEBUG'] ? :debug : :info end |