cleanup debug logging

This commit is contained in:
ddivad195
2024-02-06 17:49:12 +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;
}
const fetchWithDebug = async (url, config = {}) => {
const debugLogs = core.isDebug();
if (debugLogs) {
core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`);
}
core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`);
try {
const response = await fetch(url, config);
if (debugLogs) {
core.debug(`Response with ${JSON.stringify(response)}`);
}
core.debug(`Response with ${JSON.stringify(response)}`);
return response;
}
catch (error) {
if (debugLogs) {
core.debug(`Error with ${error}`);
}
core.debug(`Error with ${error}`);
throw error;
}
};
+3 -10
View File
@@ -204,20 +204,13 @@ const fetchWithDebug = async (
url: string,
config: RequestInit = {}
): Promise<Response> => {
const debugLogs = core.isDebug()
if (debugLogs) {
core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`)
}
core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`)
try {
const response = await fetch(url, config)
if (debugLogs) {
core.debug(`Response with ${JSON.stringify(response)}`)
}
core.debug(`Response with ${JSON.stringify(response)}`)
return response
} catch (error) {
if (debugLogs) {
core.debug(`Error with ${error}`)
}
core.debug(`Error with ${error}`)
throw error
}
}