Module: ALib::Logging::LogClassMethods
- Defined in:
- lib/alib-0.5.1/logging.rb
Overview
module LogMethods
Instance Method Summary collapse
Instance Method Details
#default_logger ⇒ Object
–{{{
156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/alib-0.5.1/logging.rb', line 156 def default_logger #--{{{ return @default_logger if defined?(@default_logger) __logger_sync do unless defined?(@default_logger) self.default_logger = Logger.new STDERR # @default_logger.warn{ "<#{ self }> using default logger"} end end @default_logger #--}}} end |
#default_logger=(log) ⇒ Object
–}}}
168 169 170 171 172 173 174 175 176 177 |
# File 'lib/alib-0.5.1/logging.rb', line 168 def default_logger= log #--{{{ __logger_sync do @default_logger = (Logger === log ? log : Logger::new(log)) @default_logger.extend LoggerExt @default_logger.logdev.dev.sync = true rescue nil @default_logger end #--}}} end |