loglevel-mixin 6.0.4 → 6.1.0
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/LICENSE +1 -1
- package/README.md +23 -17
- package/package.json +5 -5
- package/src/loglevel-mixin.mjs +9 -9
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -56,22 +56,28 @@ npm install loglevel-mixin
|
|
|
56
56
|
|
|
57
57
|
### Table of Contents
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
- [loglevel-mixin](#loglevel-mixin)
|
|
60
|
+
- [usage](#usage)
|
|
61
|
+
- [install](#install)
|
|
62
|
+
- [API](#api)
|
|
63
|
+
- [Table of Contents](#table-of-contents)
|
|
64
|
+
- [Logger](#logger)
|
|
65
|
+
- [Properties](#properties)
|
|
66
|
+
- [Loglevel](#loglevel)
|
|
67
|
+
- [Properties](#properties-1)
|
|
68
|
+
- [defaultLogLevels](#defaultloglevels)
|
|
69
|
+
- [declareLevels](#declarelevels)
|
|
70
|
+
- [Parameters](#parameters)
|
|
71
|
+
- [defineLoggerMethods](#defineloggermethods)
|
|
72
|
+
- [Parameters](#parameters-1)
|
|
73
|
+
- [Examples](#examples)
|
|
74
|
+
- [LOGLEVEL](#loglevel-1)
|
|
75
|
+
- [LogLevelMixin](#loglevelmixin)
|
|
76
|
+
- [Parameters](#parameters-2)
|
|
77
|
+
- [Examples](#examples-1)
|
|
78
|
+
- [makeLogEvent](#makelogevent)
|
|
79
|
+
- [Parameters](#parameters-3)
|
|
80
|
+
- [license](#license)
|
|
75
81
|
|
|
76
82
|
## Logger
|
|
77
83
|
|
|
@@ -168,7 +174,7 @@ Returns **class** newly created class ready to be further extendet/used
|
|
|
168
174
|
|
|
169
175
|
## makeLogEvent
|
|
170
176
|
|
|
171
|
-
Helper function to aggregate values into a log event
|
|
177
|
+
Helper function to aggregate values into a log event.
|
|
172
178
|
|
|
173
179
|
### Parameters
|
|
174
180
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loglevel-mixin",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"ava": "^
|
|
33
|
-
"c8": "^7.
|
|
32
|
+
"ava": "^4.0.1",
|
|
33
|
+
"c8": "^7.11.0",
|
|
34
34
|
"documentation": "^13.2.5",
|
|
35
|
-
"semantic-release": "^
|
|
35
|
+
"semantic-release": "^19.0.2"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
|
-
"node": ">=14.
|
|
38
|
+
"node": ">=14.18.3"
|
|
39
39
|
},
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|
package/src/loglevel-mixin.mjs
CHANGED
|
@@ -74,24 +74,24 @@ export function defineLoggerMethods(
|
|
|
74
74
|
{
|
|
75
75
|
value:
|
|
76
76
|
theFunction === undefined
|
|
77
|
-
? function(
|
|
77
|
+
? function(arg,...args) {
|
|
78
78
|
if (this.logLevelPriority >= priority) {
|
|
79
79
|
this.log(
|
|
80
80
|
name,
|
|
81
|
-
typeof
|
|
82
|
-
?
|
|
83
|
-
:
|
|
81
|
+
typeof arg === "function"
|
|
82
|
+
? arg(name)
|
|
83
|
+
: arg, ...args
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
: function(
|
|
87
|
+
: function(arg,...args) {
|
|
88
88
|
if (this.logLevelPriority >= priority) {
|
|
89
89
|
theFunction.call(
|
|
90
90
|
this,
|
|
91
91
|
name,
|
|
92
|
-
typeof
|
|
93
|
-
?
|
|
94
|
-
:
|
|
92
|
+
typeof arg === "function"
|
|
93
|
+
? arg(name)
|
|
94
|
+
: arg, ...args
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
},
|
|
@@ -166,7 +166,7 @@ export function LogLevelMixin(
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
|
-
* Helper function to aggregate values into a log event
|
|
169
|
+
* Helper function to aggregate values into a log event.
|
|
170
170
|
* @param {string} severity log severity
|
|
171
171
|
* @param {string|Object} arg original log message - level may be overwritten
|
|
172
172
|
* @param {Object} [args] additional values to be merged into the final log event - values have precedence
|