loglevel-mixin 7.2.1 → 7.2.2
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/package.json +11 -10
- package/src/loglevel-mixin.mjs +2 -2
- package/types/loglevel-mixin.d.mts +6 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loglevel-mixin",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"types": "./types/loglevel-mixin.d.mts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"default": "./src/loglevel-mixin.mjs",
|
|
12
|
+
"types": "./types/loglevel-mixin.d.mts"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"description": "mixin to declare logging methods named after a set of log levels",
|
|
@@ -25,26 +25,27 @@
|
|
|
25
25
|
],
|
|
26
26
|
"license": "BSD-2-Clause",
|
|
27
27
|
"scripts": {
|
|
28
|
-
"prepare": "
|
|
28
|
+
"prepare": "npm run prepare:typescript",
|
|
29
|
+
"prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
|
|
29
30
|
"test": "npm run test:browser-ava && npm run test:ava",
|
|
30
31
|
"test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
|
|
31
32
|
"test:browser-ava": "browser-ava --headless --no-keep-open tests/*-ava.mjs tests/*-ava-browser.mjs",
|
|
32
33
|
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
|
|
33
34
|
"docs": "documentation readme --section=API ./src/**/*.mjs",
|
|
34
|
-
"lint": "npm run lint:docs && npm run lint:
|
|
35
|
+
"lint": "npm run lint:docs && npm run lint:typescript",
|
|
35
36
|
"lint:docs": "documentation lint ./src/**/*.mjs",
|
|
36
|
-
"lint:
|
|
37
|
+
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"ava": "^6.1.
|
|
40
|
-
"browser-ava": "^2.2.
|
|
40
|
+
"ava": "^6.1.2",
|
|
41
|
+
"browser-ava": "^2.2.2",
|
|
41
42
|
"c8": "^9.1.0",
|
|
42
43
|
"documentation": "^14.0.3",
|
|
43
44
|
"semantic-release": "^23.0.2",
|
|
44
|
-
"typescript": "^5.
|
|
45
|
+
"typescript": "^5.4.2"
|
|
45
46
|
},
|
|
46
47
|
"engines": {
|
|
47
|
-
"node": ">=20.11.
|
|
48
|
+
"node": ">=20.11.1"
|
|
48
49
|
},
|
|
49
50
|
"repository": {
|
|
50
51
|
"type": "git",
|
package/src/loglevel-mixin.mjs
CHANGED
|
@@ -53,7 +53,7 @@ export function declareLevels(list) {
|
|
|
53
53
|
* This function will only be called if the current loglevel is greater equal
|
|
54
54
|
* the log level of the called logging function.
|
|
55
55
|
* By default a method log(level,message) will be used
|
|
56
|
-
* @return {
|
|
56
|
+
* @return {void}
|
|
57
57
|
* @example
|
|
58
58
|
* defineLoggerMethods( obj)
|
|
59
59
|
* obj.info('info entry'); // will redirect to theFunction if obj.loglevel is at least info
|
|
@@ -159,7 +159,7 @@ export function LogLevelMixin(
|
|
|
159
159
|
* @param {string} severity log severity
|
|
160
160
|
* @param {string|Object} arg original log message - level may be overwritten
|
|
161
161
|
* @param {Object} [args] additional values to be merged into the final log event - values have precedence
|
|
162
|
-
* @return {
|
|
162
|
+
* @return {{message:string}}} suitable for log event processing
|
|
163
163
|
*/
|
|
164
164
|
export function makeLogEvent(severity, arg, args) {
|
|
165
165
|
if (typeof arg === "string") {
|
|
@@ -14,13 +14,13 @@ export function declareLevels(list: string[]): any;
|
|
|
14
14
|
* This function will only be called if the current loglevel is greater equal
|
|
15
15
|
* the log level of the called logging function.
|
|
16
16
|
* By default a method log(level,message) will be used
|
|
17
|
-
* @return {
|
|
17
|
+
* @return {void}
|
|
18
18
|
* @example
|
|
19
19
|
* defineLoggerMethods( obj)
|
|
20
20
|
* obj.info('info entry'); // will redirect to theFunction if obj.loglevel is at least info
|
|
21
21
|
* obj.error('error entry'); // will redirect to theFunction if obj.loglevel is at least error
|
|
22
22
|
*/
|
|
23
|
-
export function defineLoggerMethods(object: any, logLevels?: any, theFunction?: Logger):
|
|
23
|
+
export function defineLoggerMethods(object: any, logLevels?: any, theFunction?: Logger): void;
|
|
24
24
|
/**
|
|
25
25
|
* <!-- skip-example -->
|
|
26
26
|
* @class
|
|
@@ -64,9 +64,11 @@ export class LogLevelMixin {
|
|
|
64
64
|
* @param {string} severity log severity
|
|
65
65
|
* @param {string|Object} arg original log message - level may be overwritten
|
|
66
66
|
* @param {Object} [args] additional values to be merged into the final log event - values have precedence
|
|
67
|
-
* @return {
|
|
67
|
+
* @return {{message:string}}} suitable for log event processing
|
|
68
68
|
*/
|
|
69
|
-
export function makeLogEvent(severity: string, arg: string | any, args?: any):
|
|
69
|
+
export function makeLogEvent(severity: string, arg: string | any, args?: any): {
|
|
70
|
+
message: string;
|
|
71
|
+
};
|
|
70
72
|
export namespace defaultLogLevels {
|
|
71
73
|
namespace trace {
|
|
72
74
|
let name: string;
|