mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-02 16:23:48 +03:00
feat: replace console with logger
This commit is contained in:
parent
59846cfe2f
commit
c9be6b6b92
@ -89,7 +89,7 @@ const uploadSaveGame = async (
|
||||
"Content-Type": "application/tar",
|
||||
},
|
||||
onUploadProgress: (progressEvent) => {
|
||||
console.log(progressEvent);
|
||||
logger.log(progressEvent);
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -22,8 +22,6 @@ export class Aria2 {
|
||||
],
|
||||
{ stdio: "inherit", windowsHide: true }
|
||||
);
|
||||
|
||||
console.log(this.process);
|
||||
}
|
||||
|
||||
public static kill() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import path from "node:path";
|
||||
import fs from "node:fs";
|
||||
import { logger } from "../logger";
|
||||
|
||||
export const calculateETA = (
|
||||
totalLength: number,
|
||||
@ -33,7 +34,7 @@ export const getDirSize = async (dir: string): Promise<number> => {
|
||||
|
||||
return sizes.reduce((total, size) => total + size, 0);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
@ -6,6 +6,7 @@ import type {
|
||||
TorBoxAddTorrentRequest,
|
||||
TorBoxRequestLinkRequest,
|
||||
} from "@types";
|
||||
import { logger } from "../logger";
|
||||
|
||||
export class TorBoxClient {
|
||||
private static instance: AxiosInstance;
|
||||
@ -65,8 +66,8 @@ export class TorBoxClient {
|
||||
);
|
||||
|
||||
if (response.status !== 200) {
|
||||
console.error(response.data.error);
|
||||
console.error(response.data.detail);
|
||||
logger.error(response.data.error);
|
||||
logger.error(response.data.detail);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,6 @@ export class PythonRPC {
|
||||
}
|
||||
|
||||
public static spawn(initialDownload?: StartDownloadPayload) {
|
||||
console.log([this.BITTORRENT_PORT, this.RPC_PORT, this.RPC_PASSWORD]);
|
||||
|
||||
const commonArgs = [
|
||||
this.BITTORRENT_PORT,
|
||||
this.RPC_PORT,
|
||||
@ -86,8 +84,6 @@ export class PythonRPC {
|
||||
"main.py"
|
||||
);
|
||||
|
||||
console.log(scriptPath);
|
||||
|
||||
const childProcess = cp.spawn("python3", [scriptPath, ...commonArgs], {
|
||||
stdio: ["inherit", "inherit"],
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user