From 08f3dcabcdddc413c9d29ac2e36ac5f1b67bf8a3 Mon Sep 17 00:00:00 2001 From: "Hung-Han (Henry) Chen" Date: Tue, 13 Jul 2021 09:25:17 +0300 Subject: [PATCH] Export mapProcessName from /common/sentry and use it in /main/logger Signed-off-by: Hung-Han (Henry) Chen --- src/common/sentry.ts | 2 +- src/main/logger.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/sentry.ts b/src/common/sentry.ts index da0e749994..80f94a9a3f 100644 --- a/src/common/sentry.ts +++ b/src/common/sentry.ts @@ -28,7 +28,7 @@ import logger from "../main/logger"; /** * "Translate" 'browser' to 'main' as Lens developer more familiar with the term 'main' */ -function mapProcessName(processType: string) { +export function mapProcessName(processType: string) { if (processType === "browser") { return "main"; } diff --git a/src/main/logger.ts b/src/main/logger.ts index c811b0b56b..cda3a662ba 100644 --- a/src/main/logger.ts +++ b/src/main/logger.ts @@ -23,6 +23,7 @@ import { app, remote } from "electron"; import winston from "winston"; import * as Sentry from "@sentry/electron"; import { isDebugging, isTestEnv } from "../common/vars"; +import { mapProcessName } from "../common/sentry"; const logLevel = process.env.LOG_LEVEL ? process.env.LOG_LEVEL : isDebugging ? "debug" : "info"; const consoleOptions: winston.transports.ConsoleTransportOptions = { @@ -74,7 +75,7 @@ const proxiedLogger: Logger = new Proxy(logger, { property(...params); const tags = { - process: process.type, + process: mapProcessName(process.type), logger: "winston" };