Revert "feat(logging): report important keyboard events"
This reverts commit b59da8f7e4.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import * as Sentry from "@sentry/nextjs";
|
||||
import type { CaptureContext, SeverityLevel } from "@sentry/nextjs";
|
||||
|
||||
export type RemoteLogLevel = "debug" | "info" | "warn" | "error" | "fatal";
|
||||
export type RemoteLogLevel = "warn" | "error" | "fatal";
|
||||
|
||||
export interface SentryLogPayload {
|
||||
level: RemoteLogLevel;
|
||||
|
||||
+3
-13
@@ -79,11 +79,6 @@ export class Logger {
|
||||
this.write("fatal", args);
|
||||
}
|
||||
|
||||
important(level: RemoteLogLevel, ...args: LogArgs): void {
|
||||
Logger.reportProductionLog(level, this.component, args, true);
|
||||
this.writeLocal(level, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* 把日志中的任意数据转成人眼友好的多行文本。
|
||||
* - object / array: pretty JSON
|
||||
@@ -151,11 +146,8 @@ export class Logger {
|
||||
}
|
||||
|
||||
private write(level: LogLevel, args: LogArgs): void {
|
||||
Logger.reportProductionLog(level, this.component, args);
|
||||
this.writeLocal(level, args);
|
||||
}
|
||||
Logger.reportImportantProductionLog(level, this.component, args);
|
||||
|
||||
private writeLocal(level: LogLevel, args: LogArgs): void {
|
||||
if (Logger.shouldUseBrowserConsole()) {
|
||||
Logger.writeBrowserConsole(level, this.component, args);
|
||||
return;
|
||||
@@ -192,14 +184,12 @@ export class Logger {
|
||||
);
|
||||
}
|
||||
|
||||
private static reportProductionLog(
|
||||
private static reportImportantProductionLog(
|
||||
level: LogLevel,
|
||||
component: string,
|
||||
args: LogArgs,
|
||||
force = false,
|
||||
): void {
|
||||
if (!force && !Logger.shouldReportToRemote(level)) return;
|
||||
if (force && !AppEnvUtil.isProduction()) return;
|
||||
if (!Logger.shouldReportToRemote(level)) return;
|
||||
|
||||
const { message, data } = Logger.toBrowserConsolePayload(args);
|
||||
reportSentryLog({
|
||||
|
||||
Reference in New Issue
Block a user