Module: Logging
- Included in:
- Albacore::Task, Failure
- Defined in:
- lib/albacore/support/logging.rb
Instance Attribute Summary collapse
-
#current_log_device ⇒ Object
Returns the value of attribute current_log_device.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #create_logger(device, level) ⇒ Object
- #initialize ⇒ Object
- #log_device=(logdev) ⇒ Object
- #log_level ⇒ Object
- #log_level=(level) ⇒ Object
Instance Attribute Details
#current_log_device ⇒ Object
Returns the value of attribute current_log_device.
4 5 6 |
# File 'lib/albacore/support/logging.rb', line 4 def current_log_device @current_log_device end |
#logger ⇒ Object
Returns the value of attribute logger.
4 5 6 |
# File 'lib/albacore/support/logging.rb', line 4 def logger @logger end |
Instance Method Details
#create_logger(device, level) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/albacore/support/logging.rb', line 30 def create_logger(device, level) @current_log_device = device @logger = Logger.new(device) level = Logger::DEBUG if Albacore.configure.log_level == :verbose @logger.level = level @log_level = :verbose if level == Logger::DEBUG end |
#initialize ⇒ Object
6 7 8 9 |
# File 'lib/albacore/support/logging.rb', line 6 def initialize create_logger(STDOUT, Logger::INFO) super() end |
#log_device=(logdev) ⇒ Object
11 12 13 14 |
# File 'lib/albacore/support/logging.rb', line 11 def log_device=(logdev) level = @logger.level create_logger(logdev, level) end |
#log_level ⇒ Object
26 27 28 |
# File 'lib/albacore/support/logging.rb', line 26 def log_level @log_level end |
#log_level=(level) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/albacore/support/logging.rb', line 16 def log_level=(level) @log_level = level if (level == :verbose) loglevel = Logger::DEBUG else loglevel = Logger::INFO end create_logger(@current_log_device, loglevel) end |