Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
at main 100 lines 2.2 kB view raw
1/** 2 * DO NOT IMPORT THIS DIRECTLY 3 * 4 * Logger contexts, defined here and used via `Logger.Context.*` static prop. 5 */ 6export enum LogContext { 7 Default = 'logger', 8 Session = 'session', 9 Notifications = 'notifications', 10 ConversationAgent = 'conversation-agent', 11 DMsAgent = 'dms-agent', 12 ReportDialog = 'report-dialog', 13 FeedFeedback = 'feed-feedback', 14 PostSource = 'post-source', 15 AgeAssurance = 'age-assurance', 16 PolicyUpdate = 'policy-update', 17 Geolocation = 'geolocation', 18 Drafts = 'drafts', 19 20 /** 21 * METRIC IS FOR INTERNAL USE ONLY, don't create any other loggers using this 22 * context 23 */ 24 Metric = 'metric', 25} 26 27export enum LogLevel { 28 Debug = 'debug', 29 Info = 'info', 30 Log = 'log', 31 Warn = 'warn', 32 Error = 'error', 33} 34 35export type Transport = ( 36 level: LogLevel, 37 context: LogContext | undefined, 38 message: string | Error, 39 metadata: Metadata, 40 timestamp: number, 41) => void 42 43/** 44 * A union of some of Sentry's breadcrumb properties as well as Sentry's 45 * `captureException` parameter, `CaptureContext`. 46 */ 47export type Metadata = { 48 /** 49 * Reserved for appending `LogContext` in logging payloads 50 */ 51 __context__?: undefined 52 53 /** 54 * Reserved for inherited metadata gathered in ambient context 55 */ 56 __metadata__?: Record<string, unknown> 57 58 /** 59 * Applied as Sentry breadcrumb types. Defaults to `default`. 60 * 61 * @see https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types 62 */ 63 type?: 64 | 'default' 65 | 'debug' 66 | 'error' 67 | 'navigation' 68 | 'http' 69 | 'info' 70 | 'query' 71 | 'transaction' 72 | 'ui' 73 | 'user' 74 75 /** 76 * Passed through to `Sentry.captureException` 77 * 78 * @see https://github.com/getsentry/sentry-javascript/blob/903addf9a1a1534a6cb2ba3143654b918a86f6dd/packages/types/src/misc.ts#L65 79 */ 80 tags?: { 81 [key: string]: number | string | boolean | null | undefined 82 } 83 84 /** 85 * Any additional data, passed through to Sentry as `extra` param on 86 * exceptions, or the `data` param on breadcrumbs. 87 */ 88 [key: string]: Serializable | Error | unknown 89} 90 91export type Serializable = 92 | string 93 | number 94 | boolean 95 | null 96 | undefined 97 | Serializable[] 98 | { 99 [key: string]: Serializable 100 }