Switch to stdlib log
Closes https://github.com/iv-org/invidious/issues/5413
- Kemal was upgraded to 1.7.2 (1.7.0 is the one that introduced integration with the stdlib Log)
CONFIG.outputworks again (it didn't seem to work when I tested it)- ~Some functions were encapsulated into modules (
YoutubeJSONParser,Parser,I18n, and others) to keep thesource(from where the Log function is being called) consistent for some functions.~ - ~A macro
::Log.forfwas added to add the function name to the source so we can prevent usingLog.info { "fetch_channel: something" },Log.info { "fetch_channel: something2" }, etc.~
How it looks and behaves: https://asciinema.org/a/WQXsdnxcV1Hu7fOufJeMEaovZ
It's slower (~1.06x times slower) than using the old Invidious::LogHandler, but this is mostly because of heavy use of colorization. Without colorization, Log is 1.12x times faster.
With the Invidious::Logger.formatter added in this PR, it's possible to use Log.info &.emit("msg", error: "someerror", debuginfo: response.data) or something like that which may be useful for better context in the logs.
Can be split off into smaller PRs that can be merged after this main migration. Having it all in one adds a bunch of noise to the primary change of switching to the stdlib logger.
Done, that should be better ;)