Improve logging

Everything that gets logged now has a log level associated with it.

The log level can be set with the new `-l` or `--log-level` arguments.

The defaul log level is `debug` for now. There aren't many things that get
logged but if the logs get spammed in the future it can be set down to `info`.
This commit is contained in:
saltycrys
2020-12-21 16:05:35 +01:00
parent dba7dc4e96
commit b39f01dcdf
8 changed files with 51 additions and 57 deletions

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.puts("#{id} : #{ex.message}")
logger.error("get_video: #{id} : #{ex.message}")
return error_template(500, ex)
end