cleanup debug logging
This commit is contained in:
-7
@@ -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();
|
|
||||||
if (debugLogs) {
|
|
||||||
core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`);
|
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;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -204,20 +204,13 @@ const fetchWithDebug = async (
|
|||||||
url: string,
|
url: string,
|
||||||
config: RequestInit = {}
|
config: RequestInit = {}
|
||||||
): Promise<Response> => {
|
): 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 {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user