mirror of
https://github.com/iv-org/invidious.git
synced 2025-05-18 14:20:34 -04:00
YoutubeAPI: add debug/trace logging
This commit is contained in:
parent
9d2932afdb
commit
a1489e6280
1 changed files with 14 additions and 0 deletions
|
@ -84,6 +84,15 @@ module YoutubeAPI
|
|||
def api_key : String
|
||||
HARDCODED_CLIENTS[@client_type][:api_key]
|
||||
end
|
||||
|
||||
# Convert to string, for logging purposes
|
||||
def to_s
|
||||
return {
|
||||
client_type: self.name,
|
||||
region: @region,
|
||||
proxy_region: @proxy_region,
|
||||
}.to_s
|
||||
end
|
||||
end
|
||||
|
||||
# Default client config, used if nothing is passed
|
||||
|
@ -341,6 +350,11 @@ module YoutubeAPI
|
|||
"Accept-Encoding" => "gzip",
|
||||
}
|
||||
|
||||
# Logging
|
||||
LOGGER.debug("YoutubeAPI: Using endpoint: \"#{endpoint}\"")
|
||||
LOGGER.trace("YoutubeAPI: ClientConfig: #{client_config.to_s}")
|
||||
LOGGER.trace("YoutubeAPI: POST data: #{data.to_s}")
|
||||
|
||||
# Send the POST request
|
||||
if client_config.proxy_region
|
||||
response = YT_POOL.client(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue