loglevel-mixin 7.2.7 → 7.2.8
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
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loglevel-mixin",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
7
7
|
},
|
|
8
|
-
"packageManager": "npm@11.
|
|
8
|
+
"packageManager": "npm@11.10.0+sha512.8bc844e37892200305b98562f13c6c10849d10b3387c8cdaeb4d1a2e32746a79063cba9dd284cf28c26a01c3bf4169b7d3b31b4a5586cc970d6749463108073c",
|
|
9
9
|
"types": "./types/loglevel-mixin.d.mts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"ava": "^6.4.1",
|
|
42
|
-
"browser-ava": "^2.3.
|
|
42
|
+
"browser-ava": "^2.3.53",
|
|
43
43
|
"c8": "^10.1.3",
|
|
44
44
|
"documentation": "^14.0.3",
|
|
45
|
-
"semantic-release": "^25.0.
|
|
45
|
+
"semantic-release": "^25.0.3",
|
|
46
46
|
"typescript": "^5.9.3"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=24.13.
|
|
49
|
+
"node": ">=24.13.1"
|
|
50
50
|
},
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
package/src/loglevel-mixin.mjs
CHANGED
|
@@ -59,11 +59,7 @@ export function declareLevels(list) {
|
|
|
59
59
|
* obj.info('info entry'); // will redirect to theFunction if obj.loglevel is at least info
|
|
60
60
|
* obj.error('error entry'); // will redirect to theFunction if obj.loglevel is at least error
|
|
61
61
|
*/
|
|
62
|
-
export function defineLoggerMethods(
|
|
63
|
-
object,
|
|
64
|
-
logLevels = defaultLogLevels,
|
|
65
|
-
theFunction
|
|
66
|
-
) {
|
|
62
|
+
export function defineLoggerMethods(object, logLevels, theFunction) {
|
|
67
63
|
Object.defineProperties(
|
|
68
64
|
object,
|
|
69
65
|
Object.fromEntries(
|
|
@@ -139,7 +135,11 @@ export function LogLevelMixin(
|
|
|
139
135
|
* @param {string} level
|
|
140
136
|
*/
|
|
141
137
|
set logLevel(level) {
|
|
142
|
-
|
|
138
|
+
const logLevel = logLevels[level];
|
|
139
|
+
|
|
140
|
+
if (logLevel) {
|
|
141
|
+
this.#logLevel = logLevel;
|
|
142
|
+
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
/**
|
|
@@ -20,7 +20,7 @@ export function declareLevels(list: string[]): any;
|
|
|
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
|
|
23
|
+
export function defineLoggerMethods(object: any, logLevels: any, theFunction?: Logger): void;
|
|
24
24
|
/**
|
|
25
25
|
* <!-- skip-example -->
|
|
26
26
|
* @class
|