Class: Pacproxy::GeneralLogger
- Inherits:
-
Object
- Object
- Pacproxy::GeneralLogger
- Includes:
- Singleton
- Defined in:
- lib/pacproxy/general_logger.rb
Overview
Provide log Function
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize ⇒ GeneralLogger
constructor
A new instance of GeneralLogger.
Constructor Details
#initialize ⇒ GeneralLogger
Returns a new instance of GeneralLogger.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/pacproxy/general_logger.rb', line 11 def initialize c = Config.instance.config['general_log'] return @logger = nil unless c location = c['location'] ? c['location'] : STDOUT shift_age = c['shift_age'] ? c['shift_age'] : 0 shift_size = c['shift_size'] ? c['shift_size'] : 1_048_576 @logger = Logger.new(location, shift_age, shift_size) @logger.level = c['log_level'] ? Logger.const_get(c['log_level']) : Logger::ERROR @logger.progname = 'pacproxy' end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
9 10 11 |
# File 'lib/pacproxy/general_logger.rb', line 9 def logger @logger end |