X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fircbot.rb;h=2e808b9ee5d5503cc459b7f88173553266b5a3e2;hb=41276911b95c934dd5f33ccef53b03bc9dd40975;hp=46e4faaac7a6e0a90daa6dd43152c1eee5c7beb6;hpb=85bfb8405528b2da203291b5671f9077d5b62742;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 46e4faaa..2e808b9e 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -15,7 +15,7 @@ $debug = false unless $debug $daemonize = false unless $daemonize $dateformat = "%Y/%m/%d %H:%M:%S" -$logger = Logger.new($stderr) +$logger = Logger.new(STDERR) $logger.datetime_format = $dateformat $logger.level = $cl_loglevel if defined? $cl_loglevel $logger.level = 0 if $debug @@ -127,12 +127,6 @@ def fatal(message=nil, who_pos=1) rawlog(Logger::Severity::FATAL, message, who_pos) end -debug "debug test" -log "log test" -warning "warning test" -error "error test" -fatal "fatal test" - # The following global is used for the improved signal handling. $interrupted = 0 @@ -163,7 +157,7 @@ module Irc # handles them or passes them to plugins, and contains core functionality. class Bot COPYRIGHT_NOTICE = "(c) Giuseppe Bilotta and the rbot development team" - SOURCE_URL = "http://ruby-rbot.org" + SOURCE_URL = "https://ruby-rbot.org" # the bot's Auth data attr_reader :auth @@ -226,13 +220,6 @@ class Bot myself.channels end - # returns the journal - def journal - if @plugins['journal'] - @plugins['journal'].broker - end - end - # nick wanted by the bot. This defaults to the irc.nick config value, # but may be overridden by a manual !nick command def wanted_nick @@ -541,15 +528,17 @@ class Bot # File.umask 0000 # Ensure sensible umask. Adjust as needed. end - logger = Logger.new(@logfile, - @config['log.keep'], - @config['log.max_size']*1024*1024) - logger.datetime_format= $dateformat - logger.level = @config['log.level'] - logger.level = $cl_loglevel if defined? $cl_loglevel - logger.level = 0 if $debug + unless $debug + logger = Logger.new(@logfile, + @config['log.keep'], + @config['log.max_size']*1024*1024) + logger.datetime_format= $dateformat + logger.level = @config['log.level'] + logger.level = $cl_loglevel if defined? $cl_loglevel + logger.level = 0 if $debug - restart_logger(logger) + restart_logger(logger) + end log_session_start