Module: Aliyun::Log::Common::Logging
Constant Summary collapse
- MAX_NUM_LOG =
100
- ROTATE_SIZE =
10 * 1024 * 1024
Class Method Summary collapse
- .log_file=(log_file) ⇒ Object
-
.log_level=(level) ⇒ Object
level = Logger::DEBUG | Logger::INFO | Logger::ERROR | Logger::FATAL.
- .logger ⇒ Object
- .logger=(logger) ⇒ Object
- .logger_level ⇒ Object
Instance Method Summary collapse
Class Method Details
.log_file=(log_file) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/aliyun/log/common/logging.rb', line 26 def self.log_file=(log_file) @logger = Logger.new( log_file, MAX_NUM_LOG, ROTATE_SIZE ) @logger.level = Logging.logger_level end |
.log_level=(level) ⇒ Object
level = Logger::DEBUG | Logger::INFO | Logger::ERROR | Logger::FATAL
17 18 19 20 |
# File 'lib/aliyun/log/common/logging.rb', line 17 def self.log_level=(level) @logger_level = level Logging.logger.level = level end |
.logger ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/aliyun/log/common/logging.rb', line 38 def self.logger unless @logger @logger = Logger.new( @log_file ||= Config.log_file || IO::NULL, MAX_NUM_LOG, ROTATE_SIZE ) @logger.level = Logging.logger_level end @logger end |
.logger=(logger) ⇒ Object
22 23 24 |
# File 'lib/aliyun/log/common/logging.rb', line 22 def self.logger=(logger) @logger = logger end |