diff options
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/ircbot.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 33def8bc..9aef8408 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -66,12 +66,18 @@ def rawlog(level, message=nil, who_pos=1) $log_queue.push qmsg end -def restart_logger(newlogger = false) +def halt_logger if $log_thread && $log_thread.alive? $log_queue << nil $log_thread.join $log_thread = nil end +end + +END { halt_logger } + +def restart_logger(newlogger = false) + halt_logger $logger = newlogger if newlogger |