lib/adhearsion/logging.rb in adhearsion-2.6.4 vs lib/adhearsion/logging.rb in adhearsion-3.0.0.beta1

- old
+ new

@@ -46,43 +46,36 @@ self.logging_level = :fatal end # Restore the default configured logging level def unsilence! - self.logging_level = Adhearsion.config.platform.logging['level'] + self.logging_level = Adhearsion.config.core.logging['level'] end # Toggle between the configured log level and :trace # Useful for debugging a live Adhearsion instance def toggle_trace! - if level == ::Logging.level_num(Adhearsion.config.platform.logging['level']) + if level == ::Logging.level_num(Adhearsion.config.core.logging['level']) logger.warn "Turning TRACE logging ON." self.level = :trace else logger.warn "Turning TRACE logging OFF." - self.level = Adhearsion.config.platform.logging['level'] + self.level = Adhearsion.config.core.logging['level'] end end - # Close logfiles and reopen them. Useful for log rotation. - def reopen_logs - logger.info "Closing logfiles." - ::Logging.reopen - logger.info "Logfiles reopened." - end - def init ::Logging.init LOG_LEVELS LOG_LEVELS.each do |level| Adhearsion::Logging.const_defined?(level) or Adhearsion::Logging.const_set(level, ::Logging::LEVELS[::Logging.levelify(level)]) end + + ::Logging.logger.root.appenders = default_appenders end - def start(_appenders = nil, level = :info, formatter = nil) - ::Logging.logger.root.appenders = _appenders.nil? ? default_appenders : _appenders - + def start(level = :info, formatter = nil) ::Logging.logger.root.level = level self.formatter = formatter if formatter end @@ -116,21 +109,9 @@ alias :level :logging_level def sanitized_logger_name(name) name.to_s.gsub(/\W/, '').downcase end - - def outputters=(outputters) - ::Logging.logger.root.appenders = outputters - end - - alias :appenders= :outputters= - - def outputters - ::Logging.logger.root.appenders - end - - alias :appenders :outputters def formatter=(formatter) ::Logging.logger.root.appenders.each do |appender| appender.layout = formatter end