Files
bsky-social-app/src/logger/types.ts
Eric Bailey 328aa2be94 [APP-1356] Policy update dialog (#8782)
* Add blocking announcement dialog feature

* WIP custom dialog

* Rework dialog and add native FocusScope

* Lock scroll on web, fix backdrop

* Add web FocusScope

* Create custom Outlet for these announcements

* Clean up FocusScope native impl

* Comments

* Some styling fixes

* Handle screen reader specifically

* Clean up state, remove Portal edits

* Reorg, rename

* Add syncing, tests

* Revert dialog updates

* Revert formatting

* Delete unused file

* Format

* Add FullWindowOverlay

* remove mmkv storage in debug btn

* Add debug code

* fix taps passing through on iOS

* Reorg

* Reorg, rename everything

* Complete policy update after signup

* Add logger

* Move context around, unmount portals on native

* Move a11y prop into FocusScope

* Remove useMemo

* Update dates

* Move debug to dev settings

* Unmount web portals until policy update completed

* UPdate dates

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
2025-08-06 15:15:52 -05:00

94 lines
2.0 KiB
TypeScript

/**
* 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',
ConversationAgent = 'conversation-agent',
DMsAgent = 'dms-agent',
ReportDialog = 'report-dialog',
FeedFeedback = 'feed-feedback',
PostSource = 'post-source',
AgeAssurance = 'age-assurance',
PolicyUpdate = 'policy-update',
/**
* METRIC IS FOR INTERNAL USE ONLY, don't create any other loggers using this
* context
*/
Metric = 'metric',
}
export enum LogLevel {
Debug = 'debug',
Info = 'info',
Log = 'log',
Warn = 'warn',
Error = 'error',
}
export type Transport = (
level: LogLevel,
context: LogContext | undefined,
message: string | Error,
metadata: Metadata,
timestamp: number,
) => void
/**
* A union of some of Sentry's breadcrumb properties as well as Sentry's
* `captureException` parameter, `CaptureContext`.
*/
export type Metadata = {
/**
* Reserved for appending `LogContext` in logging payloads
*/
__context__?: undefined
/**
* Applied as Sentry breadcrumb types. Defaults to `default`.
*
* @see https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types
*/
type?:
| 'default'
| 'debug'
| 'error'
| 'navigation'
| 'http'
| 'info'
| 'query'
| 'transaction'
| 'ui'
| 'user'
/**
* Passed through to `Sentry.captureException`
*
* @see https://github.com/getsentry/sentry-javascript/blob/903addf9a1a1534a6cb2ba3143654b918a86f6dd/packages/types/src/misc.ts#L65
*/
tags?: {
[key: string]: number | string | boolean | null | undefined
}
/**
* Any additional data, passed through to Sentry as `extra` param on
* exceptions, or the `data` param on breadcrumbs.
*/
[key: string]: Serializable | Error | unknown
}
export type Serializable =
| string
| number
| boolean
| null
| undefined
| Serializable[]
| {
[key: string]: Serializable
}