feat: adding console.log

This commit is contained in:
Chubby Granny Chaser 2024-10-20 18:11:13 +01:00
parent ded56c518d
commit 735b540af4
No known key found for this signature in database
6 changed files with 63 additions and 64 deletions

View File

@ -11,7 +11,6 @@ const getGameBackupPreview = async (
) => {
const backupPath = path.join(backupsPath, `${shop}-${objectId}`);
console.log("preview invoked>>");
return Ludusavi.getBackupPreview(shop, objectId, backupPath);
};

View File

@ -36,11 +36,11 @@ export const watchAchievements = async () => {
if (!gameAchievementFiles.length) continue;
// console.log(
// "Achievements files to observe for:",
// game.title,
// gameAchievementFiles
// );
console.log(
"Achievements files to observe for:",
game.title,
gameAchievementFiles
);
for (const file of gameAchievementFiles) {
compareFile(game, file);

View File

@ -72,7 +72,7 @@ export const updateLocalUnlockedAchivements = async (game: Game) => {
gameAchievementFiles.push(...achievementFileInsideDirectory);
// console.log("Achievements files for", game.title, gameAchievementFiles);
console.log("Achievements files for", game.title, gameAchievementFiles);
const unlockedAchievements: UnlockedAchievement[] = [];

View File

@ -12,7 +12,7 @@ import {
UserNotLoggedInError,
UserWithoutCloudSubscriptionError,
} from "@shared";
// import { omit } from "lodash-es";
import { omit } from "lodash-es";
import { appVersion } from "@main/constants";
interface HydraApiOptions {
@ -109,59 +109,59 @@ export class HydraApi {
});
if (this.ADD_LOG_INTERCEPTOR) {
// this.instance.interceptors.request.use(
// (request) => {
// logger.log(" ---- REQUEST -----");
// const data = Array.isArray(request.data)
// ? request.data
// : omit(request.data, ["refreshToken"]);
// logger.log(request.method, request.url, request.params, data);
// return request;
// },
// (error) => {
// logger.error("request error", error);
// return Promise.reject(error);
// }
// );
// this.instance.interceptors.response.use(
// (response) => {
// logger.log(" ---- RESPONSE -----");
// const data = Array.isArray(response.data)
// ? response.data
// : omit(response.data, ["username", "accessToken", "refreshToken"]);
// logger.log(
// response.status,
// response.config.method,
// response.config.url,
// data
// );
// return response;
// },
// (error) => {
// logger.error(" ---- RESPONSE ERROR -----");
// const { config } = error;
// logger.error(
// config.method,
// config.baseURL,
// config.url,
// config.headers,
// config.data
// );
// if (error.response) {
// logger.error(
// "Response",
// error.response.status,
// error.response.data
// );
// } else if (error.request) {
// logger.error("Request", error.request);
// } else {
// logger.error("Error", error.message);
// }
// logger.error(" ----- END RESPONSE ERROR -------");
// return Promise.reject(error);
// }
// );
this.instance.interceptors.request.use(
(request) => {
logger.log(" ---- REQUEST -----");
const data = Array.isArray(request.data)
? request.data
: omit(request.data, ["refreshToken"]);
logger.log(request.method, request.url, request.params, data);
return request;
},
(error) => {
logger.error("request error", error);
return Promise.reject(error);
}
);
this.instance.interceptors.response.use(
(response) => {
logger.log(" ---- RESPONSE -----");
const data = Array.isArray(response.data)
? response.data
: omit(response.data, ["username", "accessToken", "refreshToken"]);
logger.log(
response.status,
response.config.method,
response.config.url,
data
);
return response;
},
(error) => {
logger.error(" ---- RESPONSE ERROR -----");
const { config } = error;
logger.error(
config.method,
config.baseURL,
config.url,
config.headers,
config.data
);
if (error.response) {
logger.error(
"Response",
error.response.status,
error.response.data
);
} else if (error.request) {
logger.error("Request", error.request);
} else {
logger.error("Error", error.message);
}
logger.error(" ----- END RESPONSE ERROR -------");
return Promise.reject(error);
}
);
}
const userAuth = await userAuthRepository.findOne({

View File

@ -81,10 +81,10 @@ export function BottomPanel() {
<small>{status}</small>
</button>
<small>
{/* <small>
{sessionHash ? `${sessionHash} -` : ""} v{version} &quot;
{VERSION_CODENAME}&quot;
</small>
</small> */}
</footer>
);
}

View File

@ -54,7 +54,7 @@ export function UploadBackgroundImageButton() {
disabled={isUploadingBackgroundImage}
>
<UploadIcon />
{isUploadingBackgroundImage ? "Uploading..." : "Upload background"}
{isUploadingBackgroundImage ? "Uploading..." : "Atualizar banner"}
</Button>
);
}