Clean up types

This commit is contained in:
Eric Bailey
2025-02-12 10:53:51 -06:00
parent df50f7d6a3
commit 66280fd731
10 changed files with 40 additions and 50 deletions
+13 -11
View File
@@ -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
}