cleanup debug logging

This commit is contained in:
ddivad195
2024-02-06 18:27:57 +00:00
parent 1167b03ce8
commit b42b69f193
2 changed files with 6 additions and 20 deletions
Generated Vendored
+3 -10
View File
@@ -71089,21 +71089,14 @@ async function uploadManifest(manifestJSON, manifestEndpoint, b64Token) {
return digestResponseHeader; return digestResponseHeader;
} }
const fetchWithDebug = async (url, config = {}) => { const fetchWithDebug = async (url, config = {}) => {
const debugLogs = core.isDebug(); core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`);
if (debugLogs) {
core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`);
}
try { try {
const response = await fetch(url, config); const response = await fetch(url, config);
if (debugLogs) { core.debug(`Response with ${JSON.stringify(response)}`);
core.debug(`Response with ${JSON.stringify(response)}`);
}
return response; return response;
} }
catch (error) { catch (error) {
if (debugLogs) { core.debug(`Error with ${error}`);
core.debug(`Error with ${error}`);
}
throw error; throw error;
} }
}; };
+3 -10
View File
@@ -204,20 +204,13 @@ const fetchWithDebug = async (
url: string, url: string,
config: RequestInit = {} config: RequestInit = {}
): Promise<Response> => { ): Promise<Response> => {
const debugLogs = core.isDebug() core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`)
if (debugLogs) {
core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`)
}
try { try {
const response = await fetch(url, config) const response = await fetch(url, config)
if (debugLogs) { core.debug(`Response with ${JSON.stringify(response)}`)
core.debug(`Response with ${JSON.stringify(response)}`)
}
return response return response
} catch (error) { } catch (error) {
if (debugLogs) { core.debug(`Error with ${error}`)
core.debug(`Error with ${error}`)
}
throw error throw error
} }
} }