Skip to content

Commit

Permalink
feat: move python rpc log to own file
Browse files Browse the repository at this point in the history
  • Loading branch information
zamitto committed Dec 24, 2024
1 parent f8b9fe8 commit e50cb74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/services/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ log.errorHandler.startCatching({

log.initialize();

export const pythonInstanceLogger = log.scope("python-instance");
export const pythonRpcLogger = log.scope("python-rpc");
export const logger = log.scope("main");
export const achievementsLogger = log.scope("achievements");
6 changes: 3 additions & 3 deletions src/main/services/python-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import fs from "node:fs";
import path from "node:path";
import crypto from "node:crypto";

import { logger } from "./logger";
import { pythonRpcLogger } from "./logger";
import { Readable } from "node:stream";
import { app, dialog } from "electron";

Expand Down Expand Up @@ -39,7 +39,7 @@ export class PythonRPC {
if (!readable) return;

readable.setEncoding("utf-8");
readable.on("data", logger.log);
readable.on("data", pythonRpcLogger.log);
}

public static spawn(
Expand Down Expand Up @@ -100,7 +100,7 @@ export class PythonRPC {

public static kill() {
if (this.pythonProcess) {
logger.log("Killing python process");
pythonRpcLogger.log("Killing python process");
this.pythonProcess.kill();
this.pythonProcess = null;
}
Expand Down

0 comments on commit e50cb74

Please sign in to comment.