Clean up types
This commit is contained in:
+13
-11
@@ -1,6 +1,17 @@
|
||||
import {LogContext} from '#/logger/logContext'
|
||||
import type {Sentry} from '#/logger/sentry/lib'
|
||||
|
||||
/**
|
||||
* DO NOT IMPORT THIS DIRECTLY
|
||||
*
|
||||
* Logger contexts, defined here and used via `Logger.Context.*` static prop.
|
||||
*/
|
||||
export enum LogContext {
|
||||
Default = 'logger',
|
||||
Session = 'session',
|
||||
Notifications = 'notifications',
|
||||
Convo = 'convo',
|
||||
}
|
||||
|
||||
export enum LogLevel {
|
||||
Debug = 'debug',
|
||||
Info = 'info',
|
||||
@@ -11,7 +22,7 @@ export enum LogLevel {
|
||||
|
||||
export type Transport = (
|
||||
level: LogLevel,
|
||||
context: keyof typeof LogContext | undefined,
|
||||
context: LogContext | undefined,
|
||||
message: string | Error,
|
||||
metadata: Metadata,
|
||||
timestamp: number,
|
||||
@@ -61,12 +72,3 @@ export type Metadata = {
|
||||
*/
|
||||
[key: string]: unknown
|
||||
} & Parameters<typeof Sentry.captureException>[1]
|
||||
|
||||
export type ConsoleTransportEntry = {
|
||||
id: string
|
||||
timestamp: number
|
||||
level: LogLevel
|
||||
context: keyof typeof LogContext | undefined
|
||||
message: string | Error
|
||||
metadata: Metadata
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user