@snap/camera-kit
Version:
Camera Kit Web
41 lines • 1.35 kB
TypeScript
import { Subject } from "rxjs";
/**
* This map associates log level names with their corresponding level value.
* This means that a configured log level will match all log entries with a level value greater than
* or equal to the configured value.
*/
export declare const logLevelMap: {
error: number;
warn: number;
log: number;
info: number;
debug: number;
};
/**
* Initializes a new logger subject.
*
* Note: currently only one `CameraKit` instance is allowed to listen to log messages at a time, therefore that is
* necessary to avoid sharing the same subject between multiple `CameraKit` instances by calling`resetLogger()`.
* Also, `resetLogger()` should be called when there is no interest in logged messages.
* This allows the previous logEntriesSubject to be GCec.
* @internal
*/
export declare function resetLogger(): Subject<LogEntry>;
export interface LogEntry {
time: Date;
module: string;
level: keyof Logger;
messages: any[];
}
export type LogLevelName = keyof typeof logLevelMap;
export type Logger = Record<LogLevelName, (message?: any, ...optionalParams: any[]) => void>;
/**
* Gets logger for a given module.
*
* @internal
*
* @param module Module name.
* @returns Logger instance.
*/
export declare function getLogger(module: string): Logger;
//# sourceMappingURL=logger.d.ts.map