@logtape/logtape 0.2.2 → 0.3.0-dev.27
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/esm/config.js +12 -5
- package/esm/level.js +39 -0
- package/esm/mod.js +2 -1
- package/package.json +1 -1
- package/script/config.js +14 -6
- package/script/level.js +44 -0
- package/script/mod.js +5 -1
- package/types/config.d.ts +6 -1
- package/types/config.d.ts.map +1 -1
- package/types/filter.d.ts +2 -1
- package/types/filter.d.ts.map +1 -1
- package/types/formatter.d.ts.map +1 -1
- package/types/level.d.ts +21 -0
- package/types/level.d.ts.map +1 -0
- package/types/level.test.d.ts.map +1 -0
- package/types/logger.d.ts +2 -1
- package/types/logger.d.ts.map +1 -1
- package/types/mod.d.ts +3 -2
- package/types/mod.d.ts.map +1 -1
- package/types/record.d.ts +1 -4
- package/types/record.d.ts.map +1 -1
package/esm/config.js
CHANGED
|
@@ -3,9 +3,9 @@ import { toFilter } from "./filter.js";
|
|
|
3
3
|
import { LoggerImpl } from "./logger.js";
|
|
4
4
|
import { getConsoleSink } from "./sink.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* The current configuration, if any. Otherwise, `null`.
|
|
7
7
|
*/
|
|
8
|
-
let
|
|
8
|
+
let currentConfig = null;
|
|
9
9
|
/**
|
|
10
10
|
* Strong references to the loggers.
|
|
11
11
|
* This is to prevent the loggers from being garbage collected so that their
|
|
@@ -60,11 +60,11 @@ const asyncDisposables = new Set();
|
|
|
60
60
|
* @param config The configuration.
|
|
61
61
|
*/
|
|
62
62
|
export async function configure(config) {
|
|
63
|
-
if (
|
|
63
|
+
if (currentConfig != null && !config.reset) {
|
|
64
64
|
throw new ConfigError("Already configured; if you want to reset, turn on the reset flag.");
|
|
65
65
|
}
|
|
66
66
|
await reset();
|
|
67
|
-
|
|
67
|
+
currentConfig = config;
|
|
68
68
|
let metaConfigured = false;
|
|
69
69
|
for (const cfg of config.loggers) {
|
|
70
70
|
if (cfg.category.length === 0 ||
|
|
@@ -130,6 +130,13 @@ export async function configure(config) {
|
|
|
130
130
|
"misconfigured. To turn off this message, configure the meta logger " +
|
|
131
131
|
"with higher log levels than {dismissLevel}.", { metaLoggerCategory: ["logtape", "meta"], dismissLevel: "info" });
|
|
132
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Get the current configuration, if any. Otherwise, `null`.
|
|
135
|
+
* @returns The current configuration, if any. Otherwise, `null`.
|
|
136
|
+
*/
|
|
137
|
+
export function getConfig() {
|
|
138
|
+
return currentConfig;
|
|
139
|
+
}
|
|
133
140
|
/**
|
|
134
141
|
* Reset the configuration. Mostly for testing purposes.
|
|
135
142
|
*/
|
|
@@ -137,7 +144,7 @@ export async function reset() {
|
|
|
137
144
|
await dispose();
|
|
138
145
|
LoggerImpl.getLogger([]).resetDescendants();
|
|
139
146
|
strongRefs.clear();
|
|
140
|
-
|
|
147
|
+
currentConfig = null;
|
|
141
148
|
}
|
|
142
149
|
/**
|
|
143
150
|
* Dispose of the disposables.
|
package/esm/level.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a log level from a string.
|
|
3
|
+
*
|
|
4
|
+
* @param level The log level as a string. This is case-insensitive.
|
|
5
|
+
* @returns The log level.
|
|
6
|
+
* @throws {TypeError} If the log level is invalid.
|
|
7
|
+
*/
|
|
8
|
+
export function parseLogLevel(level) {
|
|
9
|
+
level = level.toLowerCase();
|
|
10
|
+
switch (level) {
|
|
11
|
+
case "debug":
|
|
12
|
+
case "info":
|
|
13
|
+
case "warning":
|
|
14
|
+
case "error":
|
|
15
|
+
case "fatal":
|
|
16
|
+
return level;
|
|
17
|
+
default:
|
|
18
|
+
throw new TypeError(`Invalid log level: ${level}.`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Checks if a string is a valid log level. This function can be used as
|
|
23
|
+
* as a type guard to narrow the type of a string to a {@link LogLevel}.
|
|
24
|
+
*
|
|
25
|
+
* @param level The log level as a string. This is case-sensitive.
|
|
26
|
+
* @returns `true` if the string is a valid log level.
|
|
27
|
+
*/
|
|
28
|
+
export function isLogLevel(level) {
|
|
29
|
+
switch (level) {
|
|
30
|
+
case "debug":
|
|
31
|
+
case "info":
|
|
32
|
+
case "warning":
|
|
33
|
+
case "error":
|
|
34
|
+
case "fatal":
|
|
35
|
+
return true;
|
|
36
|
+
default:
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
package/esm/mod.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { ConfigError, configure, dispose, reset, } from "./config.js";
|
|
1
|
+
export { ConfigError, configure, dispose, getConfig, reset, } from "./config.js";
|
|
2
2
|
export { getFileSink, getRotatingFileSink } from "./filesink.node.js";
|
|
3
3
|
export { getLevelFilter, toFilter, } from "./filter.js";
|
|
4
4
|
export { defaultConsoleFormatter, defaultTextFormatter, } from "./formatter.js";
|
|
5
|
+
export { isLogLevel, parseLogLevel } from "./level.js";
|
|
5
6
|
export { getLogger } from "./logger.js";
|
|
6
7
|
export { getConsoleSink, getStreamSink, } from "./sink.js";
|
|
7
8
|
// cSpell: ignore filesink
|
package/package.json
CHANGED
package/script/config.js
CHANGED
|
@@ -23,15 +23,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ConfigError = exports.dispose = exports.reset = exports.configure = void 0;
|
|
26
|
+
exports.ConfigError = exports.dispose = exports.reset = exports.getConfig = exports.configure = void 0;
|
|
27
27
|
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
28
28
|
const filter_js_1 = require("./filter.js");
|
|
29
29
|
const logger_js_1 = require("./logger.js");
|
|
30
30
|
const sink_js_1 = require("./sink.js");
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* The current configuration, if any. Otherwise, `null`.
|
|
33
33
|
*/
|
|
34
|
-
let
|
|
34
|
+
let currentConfig = null;
|
|
35
35
|
/**
|
|
36
36
|
* Strong references to the loggers.
|
|
37
37
|
* This is to prevent the loggers from being garbage collected so that their
|
|
@@ -86,11 +86,11 @@ const asyncDisposables = new Set();
|
|
|
86
86
|
* @param config The configuration.
|
|
87
87
|
*/
|
|
88
88
|
async function configure(config) {
|
|
89
|
-
if (
|
|
89
|
+
if (currentConfig != null && !config.reset) {
|
|
90
90
|
throw new ConfigError("Already configured; if you want to reset, turn on the reset flag.");
|
|
91
91
|
}
|
|
92
92
|
await reset();
|
|
93
|
-
|
|
93
|
+
currentConfig = config;
|
|
94
94
|
let metaConfigured = false;
|
|
95
95
|
for (const cfg of config.loggers) {
|
|
96
96
|
if (cfg.category.length === 0 ||
|
|
@@ -157,6 +157,14 @@ async function configure(config) {
|
|
|
157
157
|
"with higher log levels than {dismissLevel}.", { metaLoggerCategory: ["logtape", "meta"], dismissLevel: "info" });
|
|
158
158
|
}
|
|
159
159
|
exports.configure = configure;
|
|
160
|
+
/**
|
|
161
|
+
* Get the current configuration, if any. Otherwise, `null`.
|
|
162
|
+
* @returns The current configuration, if any. Otherwise, `null`.
|
|
163
|
+
*/
|
|
164
|
+
function getConfig() {
|
|
165
|
+
return currentConfig;
|
|
166
|
+
}
|
|
167
|
+
exports.getConfig = getConfig;
|
|
160
168
|
/**
|
|
161
169
|
* Reset the configuration. Mostly for testing purposes.
|
|
162
170
|
*/
|
|
@@ -164,7 +172,7 @@ async function reset() {
|
|
|
164
172
|
await dispose();
|
|
165
173
|
logger_js_1.LoggerImpl.getLogger([]).resetDescendants();
|
|
166
174
|
strongRefs.clear();
|
|
167
|
-
|
|
175
|
+
currentConfig = null;
|
|
168
176
|
}
|
|
169
177
|
exports.reset = reset;
|
|
170
178
|
/**
|
package/script/level.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isLogLevel = exports.parseLogLevel = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Parses a log level from a string.
|
|
6
|
+
*
|
|
7
|
+
* @param level The log level as a string. This is case-insensitive.
|
|
8
|
+
* @returns The log level.
|
|
9
|
+
* @throws {TypeError} If the log level is invalid.
|
|
10
|
+
*/
|
|
11
|
+
function parseLogLevel(level) {
|
|
12
|
+
level = level.toLowerCase();
|
|
13
|
+
switch (level) {
|
|
14
|
+
case "debug":
|
|
15
|
+
case "info":
|
|
16
|
+
case "warning":
|
|
17
|
+
case "error":
|
|
18
|
+
case "fatal":
|
|
19
|
+
return level;
|
|
20
|
+
default:
|
|
21
|
+
throw new TypeError(`Invalid log level: ${level}.`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.parseLogLevel = parseLogLevel;
|
|
25
|
+
/**
|
|
26
|
+
* Checks if a string is a valid log level. This function can be used as
|
|
27
|
+
* as a type guard to narrow the type of a string to a {@link LogLevel}.
|
|
28
|
+
*
|
|
29
|
+
* @param level The log level as a string. This is case-sensitive.
|
|
30
|
+
* @returns `true` if the string is a valid log level.
|
|
31
|
+
*/
|
|
32
|
+
function isLogLevel(level) {
|
|
33
|
+
switch (level) {
|
|
34
|
+
case "debug":
|
|
35
|
+
case "info":
|
|
36
|
+
case "warning":
|
|
37
|
+
case "error":
|
|
38
|
+
case "fatal":
|
|
39
|
+
return true;
|
|
40
|
+
default:
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.isLogLevel = isLogLevel;
|
package/script/mod.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getStreamSink = exports.getConsoleSink = exports.getLogger = exports.defaultTextFormatter = exports.defaultConsoleFormatter = exports.toFilter = exports.getLevelFilter = exports.getRotatingFileSink = exports.getFileSink = exports.reset = exports.dispose = exports.configure = exports.ConfigError = void 0;
|
|
3
|
+
exports.getStreamSink = exports.getConsoleSink = exports.getLogger = exports.parseLogLevel = exports.isLogLevel = exports.defaultTextFormatter = exports.defaultConsoleFormatter = exports.toFilter = exports.getLevelFilter = exports.getRotatingFileSink = exports.getFileSink = exports.reset = exports.getConfig = exports.dispose = exports.configure = exports.ConfigError = void 0;
|
|
4
4
|
var config_js_1 = require("./config.js");
|
|
5
5
|
Object.defineProperty(exports, "ConfigError", { enumerable: true, get: function () { return config_js_1.ConfigError; } });
|
|
6
6
|
Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return config_js_1.configure; } });
|
|
7
7
|
Object.defineProperty(exports, "dispose", { enumerable: true, get: function () { return config_js_1.dispose; } });
|
|
8
|
+
Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return config_js_1.getConfig; } });
|
|
8
9
|
Object.defineProperty(exports, "reset", { enumerable: true, get: function () { return config_js_1.reset; } });
|
|
9
10
|
var filesink_node_js_1 = require("./filesink.node.js");
|
|
10
11
|
Object.defineProperty(exports, "getFileSink", { enumerable: true, get: function () { return filesink_node_js_1.getFileSink; } });
|
|
@@ -15,6 +16,9 @@ Object.defineProperty(exports, "toFilter", { enumerable: true, get: function ()
|
|
|
15
16
|
var formatter_js_1 = require("./formatter.js");
|
|
16
17
|
Object.defineProperty(exports, "defaultConsoleFormatter", { enumerable: true, get: function () { return formatter_js_1.defaultConsoleFormatter; } });
|
|
17
18
|
Object.defineProperty(exports, "defaultTextFormatter", { enumerable: true, get: function () { return formatter_js_1.defaultTextFormatter; } });
|
|
19
|
+
var level_js_1 = require("./level.js");
|
|
20
|
+
Object.defineProperty(exports, "isLogLevel", { enumerable: true, get: function () { return level_js_1.isLogLevel; } });
|
|
21
|
+
Object.defineProperty(exports, "parseLogLevel", { enumerable: true, get: function () { return level_js_1.parseLogLevel; } });
|
|
18
22
|
var logger_js_1 = require("./logger.js");
|
|
19
23
|
Object.defineProperty(exports, "getLogger", { enumerable: true, get: function () { return logger_js_1.getLogger; } });
|
|
20
24
|
var sink_js_1 = require("./sink.js");
|
package/types/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FilterLike } from "./filter.js";
|
|
2
|
-
import type { LogLevel } from "./
|
|
2
|
+
import type { LogLevel } from "./level.js";
|
|
3
3
|
import { type Sink } from "./sink.js";
|
|
4
4
|
/**
|
|
5
5
|
* A configuration for the loggers.
|
|
@@ -87,6 +87,11 @@ export interface LoggerConfig<TSinkId extends string, TFilterId extends string>
|
|
|
87
87
|
* @param config The configuration.
|
|
88
88
|
*/
|
|
89
89
|
export declare function configure<TSinkId extends string, TFilterId extends string>(config: Config<TSinkId, TFilterId>): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Get the current configuration, if any. Otherwise, `null`.
|
|
92
|
+
* @returns The current configuration, if any. Otherwise, `null`.
|
|
93
|
+
*/
|
|
94
|
+
export declare function getConfig(): Config<string, string> | null;
|
|
90
95
|
/**
|
|
91
96
|
* Reset the configuration. Mostly for testing purposes.
|
|
92
97
|
*/
|
package/types/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,MAAM,CAAC,OAAO,SAAS,MAAM,EAAE,SAAS,SAAS,MAAM;IACtE;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC7B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAEvC;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;IAE5C;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAC3B,OAAO,SAAS,MAAM,EACtB,SAAS,SAAS,MAAM;IAExB;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IAEtB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACzB;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,SAAS,CAC7B,OAAO,SAAS,MAAM,EACtB,SAAS,SAAS,MAAM,EACxB,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA+EnD;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAEzD;AAED;;GAEG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAK3C;AAED;;GAEG;AACH,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAS7C;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC;;;OAGG;gBACS,OAAO,EAAE,MAAM;CAI5B"}
|
package/types/filter.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { LogLevel
|
|
1
|
+
import type { LogLevel } from "./level.js";
|
|
2
|
+
import type { LogRecord } from "./record.js";
|
|
2
3
|
/**
|
|
3
4
|
* A filter is a function that accepts a log record and returns `true` if the
|
|
4
5
|
* record should be passed to the sink.
|
package/types/filter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../src/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../src/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAGnD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,MAAM,CAoB7D"}
|
package/types/formatter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,MAAM,CAAC;AA+B1D;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAW9D;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,SAAS,OAAO,EAAE,CAAC;AAazE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,OAAO,EAAE,CA2B7E"}
|
package/types/level.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The severity level of a {@link LogRecord}.
|
|
3
|
+
*/
|
|
4
|
+
export type LogLevel = "debug" | "info" | "warning" | "error" | "fatal";
|
|
5
|
+
/**
|
|
6
|
+
* Parses a log level from a string.
|
|
7
|
+
*
|
|
8
|
+
* @param level The log level as a string. This is case-insensitive.
|
|
9
|
+
* @returns The log level.
|
|
10
|
+
* @throws {TypeError} If the log level is invalid.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseLogLevel(level: string): LogLevel;
|
|
13
|
+
/**
|
|
14
|
+
* Checks if a string is a valid log level. This function can be used as
|
|
15
|
+
* as a type guard to narrow the type of a string to a {@link LogLevel}.
|
|
16
|
+
*
|
|
17
|
+
* @param level The log level as a string. This is case-sensitive.
|
|
18
|
+
* @returns `true` if the string is a valid log level.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isLogLevel(level: string): level is LogLevel;
|
|
21
|
+
//# sourceMappingURL=level.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../src/level.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAExE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAYrD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,QAAQ,CAW3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"level.test.d.ts","sourceRoot":"","sources":["../src/level.test.ts"],"names":[],"mappings":""}
|
package/types/logger.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Filter } from "./filter.js";
|
|
2
|
-
import type { LogLevel
|
|
2
|
+
import type { LogLevel } from "./level.js";
|
|
3
|
+
import type { LogRecord } from "./record.js";
|
|
3
4
|
import type { Sink } from "./sink.js";
|
|
4
5
|
/**
|
|
5
6
|
* A logger interface. It provides methods to log messages at different
|
package/types/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CACN,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,GACvE,MAAM,CAAC;IAEV;;;;;;;;;OASG;I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MAAM,EAAE,OAAO,EAAE,GACnB,IAAI;IAUP,IAAI,CACF,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,WAAW,EACpD,GAAG,MAAM,EAAE,OAAO,EAAE,GACnB,IAAI;IAUP,IAAI,CACF,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,WAAW,EACpD,GAAG,MAAM,EAAE,OAAO,EAAE,GACnB,IAAI;IAcP,KAAK,CACH,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,WAAW,EACpD,GAAG,MAAM,EAAE,OAAO,EAAE,GACnB,IAAI;IAUP,KAAK,CACH,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,WAAW,EACpD,GAAG,MAAM,EAAE,OAAO,EAAE,GACnB,IAAI;CASR;AASD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,SAAS,OAAO,EAAE,CAepB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,SAAS,OAAO,EAAE,GACzB,OAAO,EAAE,CAOX"}
|
package/types/mod.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { type Config, ConfigError, configure, dispose, type LoggerConfig, reset, } from "./config.js";
|
|
1
|
+
export { type Config, ConfigError, configure, dispose, getConfig, type LoggerConfig, reset, } from "./config.js";
|
|
2
2
|
export { getFileSink, getRotatingFileSink } from "./filesink.node.js";
|
|
3
3
|
export { type Filter, type FilterLike, getLevelFilter, toFilter, } from "./filter.js";
|
|
4
4
|
export { type ConsoleFormatter, defaultConsoleFormatter, defaultTextFormatter, type TextFormatter, } from "./formatter.js";
|
|
5
|
+
export { isLogLevel, type LogLevel, parseLogLevel } from "./level.js";
|
|
5
6
|
export { getLogger, type Logger } from "./logger.js";
|
|
6
|
-
export type {
|
|
7
|
+
export type { LogRecord } from "./record.js";
|
|
7
8
|
export { type ConsoleSinkOptions, type FileSinkOptions, getConsoleSink, getStreamSink, type RotatingFileSinkOptions, type Sink, type StreamSinkOptions, } from "./sink.js";
|
|
8
9
|
//# sourceMappingURL=mod.d.ts.map
|
package/types/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,WAAW,EACX,SAAS,EACT,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EACL,KAAK,MAAM,EACX,KAAK,UAAU,EACf,cAAc,EACd,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,gBAAgB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,WAAW,EACX,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EACL,KAAK,MAAM,EACX,KAAK,UAAU,EACf,cAAc,EACd,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,gBAAgB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,KAAK,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,cAAc,EACd,aAAa,EACb,KAAK,uBAAuB,EAC5B,KAAK,IAAI,EACT,KAAK,iBAAiB,GACvB,MAAM,WAAW,CAAC"}
|
package/types/record.d.ts
CHANGED
package/types/record.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IAEzB;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9C"}
|