@vvlad1973/simple-logger 2.1.9 → 2.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__test__/simple-logger.test.js +65 -65
- package/dist/classes/simple-logger.d.ts +125 -125
- package/dist/classes/simple-logger.js +294 -294
- package/dist/classes/simple-logger.js.map +1 -1
- package/dist/constants/constants.d.ts +9 -9
- package/dist/constants/constants.js +9 -9
- package/dist/helpers/helpers.d.ts +31 -31
- package/dist/helpers/helpers.js +80 -80
- package/dist/helpers/validators.d.ts +17 -17
- package/dist/helpers/validators.js +26 -26
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/types/simple-logger.types.d.ts +33 -33
- package/dist/types/simple-logger.types.js +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export const LoggerLevels = {
|
|
2
|
-
TRACE: 'trace',
|
|
3
|
-
DEBUG: 'debug',
|
|
4
|
-
INFO: 'info',
|
|
5
|
-
WARN: 'warn',
|
|
6
|
-
ERROR: 'error',
|
|
7
|
-
FATAL: 'fatal',
|
|
8
|
-
SILENT: 'silent',
|
|
9
|
-
};
|
|
1
|
+
export const LoggerLevels = {
|
|
2
|
+
TRACE: 'trace',
|
|
3
|
+
DEBUG: 'debug',
|
|
4
|
+
INFO: 'info',
|
|
5
|
+
WARN: 'warn',
|
|
6
|
+
ERROR: 'error',
|
|
7
|
+
FATAL: 'fatal',
|
|
8
|
+
SILENT: 'silent',
|
|
9
|
+
};
|
|
10
10
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { LoggerLevel, PreparedLogCall } from '../types/simple-logger.types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Extracts the message and rest of the arguments from the provided array.
|
|
4
|
-
*
|
|
5
|
-
* If the first argument is an object and the second argument is a string, the second argument is considered the message.
|
|
6
|
-
* If the first argument is a string, it is considered the message.
|
|
7
|
-
* Otherwise, an empty message is returned.
|
|
8
|
-
*
|
|
9
|
-
* @param {unknown[]} args - The array of arguments to extract the message from.
|
|
10
|
-
* @return {{ msg: string; rest: unknown[] }} An object containing the extracted message and the rest of the arguments.
|
|
11
|
-
*/
|
|
12
|
-
export declare function extractMessage(args: unknown[]): {
|
|
13
|
-
msg: string;
|
|
14
|
-
rest: unknown[];
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Extracts the context object from the provided array of arguments.
|
|
18
|
-
*
|
|
19
|
-
* @param {unknown[]} args - The array of arguments to extract the context from.
|
|
20
|
-
* @return {Record<string, unknown>} The extracted context object, or an empty object if no context is found.
|
|
21
|
-
*/
|
|
22
|
-
export declare function extractContext(args: unknown[]): Record<string, unknown>;
|
|
23
|
-
/**
|
|
24
|
-
* Returns a string with the provided label colored according to the specified logging level.
|
|
25
|
-
*
|
|
26
|
-
* @param {LoggerLevel} level - The logging level to determine the color from.
|
|
27
|
-
* @param {string} label - The label to be colored.
|
|
28
|
-
* @return {string} The colored label.
|
|
29
|
-
*/
|
|
30
|
-
export declare function colorizeLevel(level: LoggerLevel, label: string): string;
|
|
31
|
-
export declare function prepareLogCall(args: unknown[]): PreparedLogCall;
|
|
1
|
+
import type { LoggerLevel, PreparedLogCall } from '../types/simple-logger.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts the message and rest of the arguments from the provided array.
|
|
4
|
+
*
|
|
5
|
+
* If the first argument is an object and the second argument is a string, the second argument is considered the message.
|
|
6
|
+
* If the first argument is a string, it is considered the message.
|
|
7
|
+
* Otherwise, an empty message is returned.
|
|
8
|
+
*
|
|
9
|
+
* @param {unknown[]} args - The array of arguments to extract the message from.
|
|
10
|
+
* @return {{ msg: string; rest: unknown[] }} An object containing the extracted message and the rest of the arguments.
|
|
11
|
+
*/
|
|
12
|
+
export declare function extractMessage(args: unknown[]): {
|
|
13
|
+
msg: string;
|
|
14
|
+
rest: unknown[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Extracts the context object from the provided array of arguments.
|
|
18
|
+
*
|
|
19
|
+
* @param {unknown[]} args - The array of arguments to extract the context from.
|
|
20
|
+
* @return {Record<string, unknown>} The extracted context object, or an empty object if no context is found.
|
|
21
|
+
*/
|
|
22
|
+
export declare function extractContext(args: unknown[]): Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns a string with the provided label colored according to the specified logging level.
|
|
25
|
+
*
|
|
26
|
+
* @param {LoggerLevel} level - The logging level to determine the color from.
|
|
27
|
+
* @param {string} label - The label to be colored.
|
|
28
|
+
* @return {string} The colored label.
|
|
29
|
+
*/
|
|
30
|
+
export declare function colorizeLevel(level: LoggerLevel, label: string): string;
|
|
31
|
+
export declare function prepareLogCall(args: unknown[]): PreparedLogCall;
|
package/dist/helpers/helpers.js
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { LoggerLevels } from '../constants/constants.js';
|
|
3
|
-
/**
|
|
4
|
-
* Extracts the message and rest of the arguments from the provided array.
|
|
5
|
-
*
|
|
6
|
-
* If the first argument is an object and the second argument is a string, the second argument is considered the message.
|
|
7
|
-
* If the first argument is a string, it is considered the message.
|
|
8
|
-
* Otherwise, an empty message is returned.
|
|
9
|
-
*
|
|
10
|
-
* @param {unknown[]} args - The array of arguments to extract the message from.
|
|
11
|
-
* @return {{ msg: string; rest: unknown[] }} An object containing the extracted message and the rest of the arguments.
|
|
12
|
-
*/
|
|
13
|
-
export function extractMessage(args) {
|
|
14
|
-
const [first, second, ...rest] = args;
|
|
15
|
-
if (typeof first === 'object' &&
|
|
16
|
-
first !== null &&
|
|
17
|
-
typeof second === 'string') {
|
|
18
|
-
return { msg: second, rest };
|
|
19
|
-
}
|
|
20
|
-
if (typeof first === 'string') {
|
|
21
|
-
return {
|
|
22
|
-
msg: first,
|
|
23
|
-
rest: [second, ...rest].filter((value) => value !== undefined),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
return { msg: '', rest: [] };
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Extracts the context object from the provided array of arguments.
|
|
30
|
-
*
|
|
31
|
-
* @param {unknown[]} args - The array of arguments to extract the context from.
|
|
32
|
-
* @return {Record<string, unknown>} The extracted context object, or an empty object if no context is found.
|
|
33
|
-
*/
|
|
34
|
-
export function extractContext(args) {
|
|
35
|
-
const [first] = args;
|
|
36
|
-
if (typeof first === 'object' && first !== null && !Array.isArray(first)) {
|
|
37
|
-
return first;
|
|
38
|
-
}
|
|
39
|
-
return {};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Returns a string with the provided label colored according to the specified logging level.
|
|
43
|
-
*
|
|
44
|
-
* @param {LoggerLevel} level - The logging level to determine the color from.
|
|
45
|
-
* @param {string} label - The label to be colored.
|
|
46
|
-
* @return {string} The colored label.
|
|
47
|
-
*/
|
|
48
|
-
export function colorizeLevel(level, label) {
|
|
49
|
-
switch (level) {
|
|
50
|
-
case LoggerLevels.DEBUG:
|
|
51
|
-
case LoggerLevels.TRACE:
|
|
52
|
-
return chalk.gray(label);
|
|
53
|
-
case LoggerLevels.INFO:
|
|
54
|
-
return chalk.green(label);
|
|
55
|
-
case LoggerLevels.WARN:
|
|
56
|
-
return chalk.yellow(label);
|
|
57
|
-
case LoggerLevels.ERROR:
|
|
58
|
-
case LoggerLevels.FATAL:
|
|
59
|
-
return chalk.red(label);
|
|
60
|
-
default:
|
|
61
|
-
return label;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Prepares the log call by rearranging the provided arguments into a standardized format.
|
|
65
|
-
*
|
|
66
|
-
* @param {unknown[]} args - The array of arguments to prepare for the log call.
|
|
67
|
-
* @return {PreparedLogCall} The prepared log call arguments, or null if the input is invalid.
|
|
68
|
-
*/
|
|
69
|
-
}
|
|
70
|
-
export function prepareLogCall(args) {
|
|
71
|
-
if (typeof args[0] === 'string') {
|
|
72
|
-
return [args[0], ...args.slice(1)];
|
|
73
|
-
}
|
|
74
|
-
if (typeof args[0] === 'object' && args[0] !== null) {
|
|
75
|
-
const msg = typeof args[1] === 'string' ? args[1] : undefined;
|
|
76
|
-
const rest = args.slice(msg ? 2 : 1);
|
|
77
|
-
return [args[0], msg, ...rest];
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { LoggerLevels } from '../constants/constants.js';
|
|
3
|
+
/**
|
|
4
|
+
* Extracts the message and rest of the arguments from the provided array.
|
|
5
|
+
*
|
|
6
|
+
* If the first argument is an object and the second argument is a string, the second argument is considered the message.
|
|
7
|
+
* If the first argument is a string, it is considered the message.
|
|
8
|
+
* Otherwise, an empty message is returned.
|
|
9
|
+
*
|
|
10
|
+
* @param {unknown[]} args - The array of arguments to extract the message from.
|
|
11
|
+
* @return {{ msg: string; rest: unknown[] }} An object containing the extracted message and the rest of the arguments.
|
|
12
|
+
*/
|
|
13
|
+
export function extractMessage(args) {
|
|
14
|
+
const [first, second, ...rest] = args;
|
|
15
|
+
if (typeof first === 'object' &&
|
|
16
|
+
first !== null &&
|
|
17
|
+
typeof second === 'string') {
|
|
18
|
+
return { msg: second, rest };
|
|
19
|
+
}
|
|
20
|
+
if (typeof first === 'string') {
|
|
21
|
+
return {
|
|
22
|
+
msg: first,
|
|
23
|
+
rest: [second, ...rest].filter((value) => value !== undefined),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return { msg: '', rest: [] };
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Extracts the context object from the provided array of arguments.
|
|
30
|
+
*
|
|
31
|
+
* @param {unknown[]} args - The array of arguments to extract the context from.
|
|
32
|
+
* @return {Record<string, unknown>} The extracted context object, or an empty object if no context is found.
|
|
33
|
+
*/
|
|
34
|
+
export function extractContext(args) {
|
|
35
|
+
const [first] = args;
|
|
36
|
+
if (typeof first === 'object' && first !== null && !Array.isArray(first)) {
|
|
37
|
+
return first;
|
|
38
|
+
}
|
|
39
|
+
return {};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns a string with the provided label colored according to the specified logging level.
|
|
43
|
+
*
|
|
44
|
+
* @param {LoggerLevel} level - The logging level to determine the color from.
|
|
45
|
+
* @param {string} label - The label to be colored.
|
|
46
|
+
* @return {string} The colored label.
|
|
47
|
+
*/
|
|
48
|
+
export function colorizeLevel(level, label) {
|
|
49
|
+
switch (level) {
|
|
50
|
+
case LoggerLevels.DEBUG:
|
|
51
|
+
case LoggerLevels.TRACE:
|
|
52
|
+
return chalk.gray(label);
|
|
53
|
+
case LoggerLevels.INFO:
|
|
54
|
+
return chalk.green(label);
|
|
55
|
+
case LoggerLevels.WARN:
|
|
56
|
+
return chalk.yellow(label);
|
|
57
|
+
case LoggerLevels.ERROR:
|
|
58
|
+
case LoggerLevels.FATAL:
|
|
59
|
+
return chalk.red(label);
|
|
60
|
+
default:
|
|
61
|
+
return label;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Prepares the log call by rearranging the provided arguments into a standardized format.
|
|
65
|
+
*
|
|
66
|
+
* @param {unknown[]} args - The array of arguments to prepare for the log call.
|
|
67
|
+
* @return {PreparedLogCall} The prepared log call arguments, or null if the input is invalid.
|
|
68
|
+
*/
|
|
69
|
+
}
|
|
70
|
+
export function prepareLogCall(args) {
|
|
71
|
+
if (typeof args[0] === 'string') {
|
|
72
|
+
return [args[0], ...args.slice(1)];
|
|
73
|
+
}
|
|
74
|
+
if (typeof args[0] === 'object' && args[0] !== null) {
|
|
75
|
+
const msg = typeof args[1] === 'string' ? args[1] : undefined;
|
|
76
|
+
const rest = args.slice(msg ? 2 : 1);
|
|
77
|
+
return [args[0], msg, ...rest];
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
81
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ExternalLogger } from '../types/simple-logger.types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if the provided logger is a valid ExternalLogger instance.
|
|
4
|
-
*
|
|
5
|
-
* @param {unknown} logger - The logger to validate.
|
|
6
|
-
* @return {logger is ExternalLogger} True if the logger is a valid ExternalLogger, false otherwise.
|
|
7
|
-
*/
|
|
8
|
-
export declare function isValidLogger(logger: unknown): logger is ExternalLogger;
|
|
9
|
-
/**
|
|
10
|
-
* Checks if the provided logger is an ExternalLogger instance with a child method.
|
|
11
|
-
*
|
|
12
|
-
* @param {unknown} logger - The logger to check.
|
|
13
|
-
* @return {logger is ExternalLogger & { child: Function }} True if the logger is an ExternalLogger with a child method, false otherwise.
|
|
14
|
-
*/
|
|
15
|
-
export declare function hasChild(logger: unknown): logger is ExternalLogger & {
|
|
16
|
-
child: Function;
|
|
17
|
-
};
|
|
1
|
+
import type { ExternalLogger } from '../types/simple-logger.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the provided logger is a valid ExternalLogger instance.
|
|
4
|
+
*
|
|
5
|
+
* @param {unknown} logger - The logger to validate.
|
|
6
|
+
* @return {logger is ExternalLogger} True if the logger is a valid ExternalLogger, false otherwise.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isValidLogger(logger: unknown): logger is ExternalLogger;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the provided logger is an ExternalLogger instance with a child method.
|
|
11
|
+
*
|
|
12
|
+
* @param {unknown} logger - The logger to check.
|
|
13
|
+
* @return {logger is ExternalLogger & { child: Function }} True if the logger is an ExternalLogger with a child method, false otherwise.
|
|
14
|
+
*/
|
|
15
|
+
export declare function hasChild(logger: unknown): logger is ExternalLogger & {
|
|
16
|
+
child: Function;
|
|
17
|
+
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { LoggerLevels } from '../constants/constants.js';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if the provided logger is a valid ExternalLogger instance.
|
|
4
|
-
*
|
|
5
|
-
* @param {unknown} logger - The logger to validate.
|
|
6
|
-
* @return {logger is ExternalLogger} True if the logger is a valid ExternalLogger, false otherwise.
|
|
7
|
-
*/
|
|
8
|
-
export function isValidLogger(logger) {
|
|
9
|
-
const levels = Object.values(LoggerLevels);
|
|
10
|
-
if (typeof logger !== 'object' || logger === null) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
const candidate = logger;
|
|
14
|
-
return levels.some((level) => typeof candidate[level] === 'function');
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Checks if the provided logger is an ExternalLogger instance with a child method.
|
|
18
|
-
*
|
|
19
|
-
* @param {unknown} logger - The logger to check.
|
|
20
|
-
* @return {logger is ExternalLogger & { child: Function }} True if the logger is an ExternalLogger with a child method, false otherwise.
|
|
21
|
-
*/
|
|
22
|
-
export function hasChild(logger) {
|
|
23
|
-
return (typeof logger === 'object' &&
|
|
24
|
-
logger !== null &&
|
|
25
|
-
typeof logger.child === 'function');
|
|
26
|
-
}
|
|
1
|
+
import { LoggerLevels } from '../constants/constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the provided logger is a valid ExternalLogger instance.
|
|
4
|
+
*
|
|
5
|
+
* @param {unknown} logger - The logger to validate.
|
|
6
|
+
* @return {logger is ExternalLogger} True if the logger is a valid ExternalLogger, false otherwise.
|
|
7
|
+
*/
|
|
8
|
+
export function isValidLogger(logger) {
|
|
9
|
+
const levels = Object.values(LoggerLevels);
|
|
10
|
+
if (typeof logger !== 'object' || logger === null) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const candidate = logger;
|
|
14
|
+
return levels.some((level) => typeof candidate[level] === 'function');
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Checks if the provided logger is an ExternalLogger instance with a child method.
|
|
18
|
+
*
|
|
19
|
+
* @param {unknown} logger - The logger to check.
|
|
20
|
+
* @return {logger is ExternalLogger & { child: Function }} True if the logger is an ExternalLogger with a child method, false otherwise.
|
|
21
|
+
*/
|
|
22
|
+
export function hasChild(logger) {
|
|
23
|
+
return (typeof logger === 'object' &&
|
|
24
|
+
logger !== null &&
|
|
25
|
+
typeof logger.child === 'function');
|
|
26
|
+
}
|
|
27
27
|
//# sourceMappingURL=validators.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import SimpleLogger from './classes/simple-logger.js';
|
|
2
|
-
export default SimpleLogger;
|
|
3
|
-
export { SimpleLogger };
|
|
4
|
-
export * from './types/simple-logger.types.js';
|
|
5
|
-
export * from './constants/constants.js';
|
|
1
|
+
import SimpleLogger from './classes/simple-logger.js';
|
|
2
|
+
export default SimpleLogger;
|
|
3
|
+
export { SimpleLogger };
|
|
4
|
+
export type * from './types/simple-logger.types.js';
|
|
5
|
+
export * from './constants/constants.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import SimpleLogger from './classes/simple-logger.js';
|
|
2
|
-
export default SimpleLogger;
|
|
3
|
-
export { SimpleLogger };
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './constants/constants.js';
|
|
1
|
+
import SimpleLogger from './classes/simple-logger.js';
|
|
2
|
+
export default SimpleLogger;
|
|
3
|
+
export { SimpleLogger };
|
|
4
|
+
export * from './constants/constants.js';
|
|
6
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,4BAA4B,CAAC;AAEtD,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,4BAA4B,CAAC;AAEtD,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;AAGxB,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { LoggerLevels } from '../constants/constants';
|
|
2
|
-
export type LoggerLevel = (typeof LoggerLevels)[keyof typeof LoggerLevels];
|
|
3
|
-
export interface LogFn {
|
|
4
|
-
<T extends object>(obj: T, msg?: string, ...args: unknown[]): void;
|
|
5
|
-
(obj: unknown, msg?: string, ...args: unknown[]): void;
|
|
6
|
-
(msg: string, ...args: unknown[]): void;
|
|
7
|
-
}
|
|
8
|
-
export interface ExternalLogger {
|
|
9
|
-
trace?: LogFn;
|
|
10
|
-
debug?: LogFn;
|
|
11
|
-
info?: LogFn;
|
|
12
|
-
warn?: LogFn;
|
|
13
|
-
error?: LogFn;
|
|
14
|
-
fatal?: LogFn;
|
|
15
|
-
silent?: LogFn;
|
|
16
|
-
level?: string;
|
|
17
|
-
child
|
|
18
|
-
}
|
|
19
|
-
export type LoggerFactory = (options: Record<string, unknown>) => ExternalLogger;
|
|
20
|
-
export interface LoggerOptions {
|
|
21
|
-
level?: LoggerLevel;
|
|
22
|
-
bindings?: Record<string, unknown>;
|
|
23
|
-
msgPrefix?: string;
|
|
24
|
-
transport?: unknown;
|
|
25
|
-
transports?: {
|
|
26
|
-
targets: Array<{
|
|
27
|
-
tag?: string;
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
}>;
|
|
30
|
-
};
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
}
|
|
33
|
-
export type PreparedLogCall = [string, ...unknown[]] | [object, string?, ...unknown[]] | null;
|
|
1
|
+
import type { LoggerLevels } from '../constants/constants';
|
|
2
|
+
export type LoggerLevel = (typeof LoggerLevels)[keyof typeof LoggerLevels];
|
|
3
|
+
export interface LogFn {
|
|
4
|
+
<T extends object>(obj: T, msg?: string, ...args: unknown[]): void;
|
|
5
|
+
(obj: unknown, msg?: string, ...args: unknown[]): void;
|
|
6
|
+
(msg: string, ...args: unknown[]): void;
|
|
7
|
+
}
|
|
8
|
+
export interface ExternalLogger {
|
|
9
|
+
trace?: LogFn;
|
|
10
|
+
debug?: LogFn;
|
|
11
|
+
info?: LogFn;
|
|
12
|
+
warn?: LogFn;
|
|
13
|
+
error?: LogFn;
|
|
14
|
+
fatal?: LogFn;
|
|
15
|
+
silent?: LogFn;
|
|
16
|
+
level?: string;
|
|
17
|
+
child?: (bindings: Record<string, unknown>, options?: Record<string, unknown>) => ExternalLogger;
|
|
18
|
+
}
|
|
19
|
+
export type LoggerFactory = (options: Record<string, unknown>) => ExternalLogger;
|
|
20
|
+
export interface LoggerOptions {
|
|
21
|
+
level?: LoggerLevel;
|
|
22
|
+
bindings?: Record<string, unknown>;
|
|
23
|
+
msgPrefix?: string;
|
|
24
|
+
transport?: unknown;
|
|
25
|
+
transports?: {
|
|
26
|
+
targets: Array<{
|
|
27
|
+
tag?: string;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
export type PreparedLogCall = [string, ...unknown[]] | [object, string?, ...unknown[]] | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=simple-logger.types.js.map
|