UNPKG

1.21 kBTypeScriptView Raw
1/**
2 * @file Sequelize module for debug and deprecation messages.
3 * It require a `context` for which messages will be printed.
4 *
5 * @module logging
6 * @access package
7 */
8import nodeDebug from 'debug';
9/**
10 * The configuration for sequelize's logging interface.
11 *
12 * @access package
13 */
14export interface LoggerConfig {
15 /**
16 * The context which the logger should log in.
17 *
18 * @default 'sequelize'
19 */
20 context?: string;
21}
22export declare class Logger {
23 protected config: LoggerConfig;
24 constructor({ context, ...rest }?: Partial<LoggerConfig>);
25 /**
26 * Logs a warning in the logger's context.
27 *
28 * @param message The message of the warning.
29 */
30 warn(message: string): void;
31 /**
32 * Uses node's util.inspect to stringify a value.
33 *
34 * @param value The value which should be inspected.
35 * @returns The string of the inspected value.
36 */
37 inspect(value: unknown): string;
38 /**
39 * Gets a debugger for a context.
40 *
41 * @param name The name of the context.
42 * @returns A debugger interace which can be used to debug.
43 */
44 debugContext(name: string): nodeDebug.Debugger;
45}
46export declare const logger: Logger;