Make logger a constant

Instead of passing around `logger` there is now the global `LOGGER`.
This commit is contained in:
saltycrys
2021-01-04 16:51:06 +01:00
parent 7a8620a570
commit 6365ee7487
13 changed files with 103 additions and 115 deletions

View File

@@ -1,7 +1,6 @@
abstract class Invidious::Routes::BaseRoute
private getter config : Config
private getter logger : Invidious::LogHandler
def initialize(@config, @logger)
def initialize(@config)
end
end

View File

@@ -267,7 +267,7 @@ class Invidious::Routes::Login < Invidious::Routes::BaseRoute
raise "Couldn't get SID."
end
user, sid = get_user(sid, headers, PG_DB, logger)
user, sid = get_user(sid, headers, PG_DB)
# We are now logged in
traceback << "done.<br/>"

View File

@@ -62,7 +62,7 @@ class Invidious::Routes::Watch < Invidious::Routes::BaseRoute
rescue ex : VideoRedirect
return env.redirect env.request.resource.gsub(id, ex.video_id)
rescue ex
logger.error("get_video: #{id} : #{ex.message}")
LOGGER.error("get_video: #{id} : #{ex.message}")
return error_template(500, ex)
end