@datadog/mobile-react-native
Version:
A client-side React Native module to interact with Datadog
89 lines • 2.48 kB
TypeScript
import type { ErrorSource } from '../rum/types';
import type { UserInfo } from '../sdk/UserInfoSingleton/types';
/**
* The entry point to use Datadog's Logs feature.
*/
export type DdLogsType = {
/**
* Send a log with debug level.
* @param message: The message to send.
* @param context: The additional context to send.
*/
debug(...args: LogArguments | LogWithErrorArguments): Promise<void>;
/**
* Send a log with info level.
* @param message: The message to send.
* @param context: The additional context to send.
*/
info(...args: LogArguments | LogWithErrorArguments): Promise<void>;
/**
* Send a log with warn level.
* @param message: The message to send.
* @param context: The additional context to send.
*/
warn(...args: LogArguments | LogWithErrorArguments): Promise<void>;
/**
* Send a log with error level.
* @param message: The message to send.
* @param context: The additional context to send.
*/
error(...args: LogArguments | LogWithErrorArguments): Promise<void>;
};
/**
* Log input from developers
*/
export type RawLog = {
message: string;
context: object;
status: LogStatus;
};
export type RawLogWithError = {
message: string;
errorKind?: string;
errorMessage?: string;
stacktrace?: string;
context: object;
status: LogStatus;
fingerprint?: string;
source?: ErrorSource;
};
/**
* Log input for native SDKs
*/
export type NativeLog = {
message: string;
context: object;
};
export type NativeLogWithError = {
message: string;
errorKind: string;
errorMessage: string;
stacktrace: string;
context: object;
fingerprint?: string;
};
export type LogStatus = 'debug' | 'info' | 'warn' | 'error';
export type LogEvent = {
message: string;
context: object;
errorKind?: string;
errorMessage?: string;
stacktrace?: string;
fingerprint?: string;
readonly source?: ErrorSource;
readonly status: LogStatus;
readonly userInfo: UserInfo;
readonly attributes?: object;
};
export type LogEventMapper = (logEvent: LogEvent) => LogEvent | null;
export type LogArguments = [message: string, context?: object];
export type LogWithErrorArguments = [
message: string,
errorKind?: string,
errorMessage?: string,
stacktrace?: string,
context?: object,
fingerprint?: string,
source?: ErrorSource
];
//# sourceMappingURL=types.d.ts.map