Clarify types
(cherry picked from commit 422b150deb158a70ef37e8a456d91bf26cd0b1bc)
This commit is contained in:
@@ -18,7 +18,6 @@ export const bitdriftTransport: Transport = (
|
|||||||
) => {
|
) => {
|
||||||
const log = logFunctions[level]
|
const log = logFunctions[level]
|
||||||
log(message.toString(), {
|
log(message.toString(), {
|
||||||
// match Sentry payload
|
|
||||||
__context__: context,
|
__context__: context,
|
||||||
...prepareMetadata(metadata),
|
...prepareMetadata(metadata),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const sentryTransport: Transport = (
|
|||||||
timestamp,
|
timestamp,
|
||||||
) => {
|
) => {
|
||||||
const meta = {
|
const meta = {
|
||||||
// match Bitdrift payload
|
|
||||||
__context__: context,
|
__context__: context,
|
||||||
...prepareMetadata(metadata),
|
...prepareMetadata(metadata),
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-2
@@ -5,11 +5,16 @@
|
|||||||
*/
|
*/
|
||||||
export enum LogContext {
|
export enum LogContext {
|
||||||
Default = 'logger',
|
Default = 'logger',
|
||||||
Metric = 'metric',
|
|
||||||
Session = 'session',
|
Session = 'session',
|
||||||
Notifications = 'notifications',
|
Notifications = 'notifications',
|
||||||
ConversationAgent = 'conversation-agent',
|
ConversationAgent = 'conversation-agent',
|
||||||
DMsAgent = 'dms-agent',
|
DMsAgent = 'dms-agent',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* METRIC IS FOR INTERNAL USE ONLY, don't create any other loggers using this
|
||||||
|
* context
|
||||||
|
*/
|
||||||
|
Metric = 'metric',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LogLevel {
|
export enum LogLevel {
|
||||||
@@ -34,7 +39,7 @@ export type Transport = (
|
|||||||
*/
|
*/
|
||||||
export type Metadata = {
|
export type Metadata = {
|
||||||
/**
|
/**
|
||||||
* Reserved for appending `LogContext` to logging payloads
|
* Reserved for appending `LogContext` in logging payloads
|
||||||
*/
|
*/
|
||||||
__context__?: undefined
|
__context__?: undefined
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user