summaryrefslogtreecommitdiff
path: root/lib/rbot/logger.rb
AgeCommit message (Collapse)Author
2021-06-05logger: don't actually close the console loggerGiuseppe Bilotta
We nil the internal variable, but we should not close the logger itself, since this leads to STDERR being closed and the interpreter reopening it for its own needs, or something like that, which ultimately leads to the interpreter's warning appearing in console (probably due to ruby itself reopening stderr to be able to output the messages). If we simply nil the variable, the interpreter is content with sending us the messages per our shenanigangs, and everything works just as expected.
2021-06-05fix: restore logging of session start/endGiuseppe Bilotta
2021-06-05logger: fix STDERR recursionGiuseppe Bilotta
Overriding (as we should do) the standard error write method when daemonizing introduces a recursion in the logger, due to the persistent presence of the console logger. The solution is obviously to stop logging on console after daemonization.
2021-05-29fix: restart logger thread after forkGiuseppe Bilotta
Logging was broken when daemonizing, due to the logger thread being dead after the fork. This can be solved by restarting the thread, if necessary when setting the log file (which we conveniently do right after the fork).
2021-05-29fix: preserve loglevels across options and filesGiuseppe Bilotta
2020-03-31refactor: logger moved away from ircbot (exp.)Matthias Hecker
This moves the logger management thread/queue to a seperate singleton. It removes the explicit stopping/restarting of the logging thread since the thread should behave like a daemon thread anyway. Still needs to be tested to work in daemonize.