mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Export mapProcessName from /common/sentry and use it in /main/logger
Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
parent
3128bce67e
commit
08f3dcabcd
@ -28,7 +28,7 @@ import logger from "../main/logger";
|
|||||||
/**
|
/**
|
||||||
* "Translate" 'browser' to 'main' as Lens developer more familiar with the term 'main'
|
* "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") {
|
if (processType === "browser") {
|
||||||
return "main";
|
return "main";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import { app, remote } from "electron";
|
|||||||
import winston from "winston";
|
import winston from "winston";
|
||||||
import * as Sentry from "@sentry/electron";
|
import * as Sentry from "@sentry/electron";
|
||||||
import { isDebugging, isTestEnv } from "../common/vars";
|
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 logLevel = process.env.LOG_LEVEL ? process.env.LOG_LEVEL : isDebugging ? "debug" : "info";
|
||||||
const consoleOptions: winston.transports.ConsoleTransportOptions = {
|
const consoleOptions: winston.transports.ConsoleTransportOptions = {
|
||||||
@ -74,7 +75,7 @@ const proxiedLogger: Logger = new Proxy(logger, {
|
|||||||
property(...params);
|
property(...params);
|
||||||
|
|
||||||
const tags = {
|
const tags = {
|
||||||
process: process.type,
|
process: mapProcessName(process.type),
|
||||||
logger: "winston"
|
logger: "winston"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user