loglevel-mixin 6.0.2 → 6.0.6
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 +42 -42
- package/package.json +6 -6
- package/src/loglevel-mixin.mjs +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://bundlephobia.com/result?p=loglevel-mixin)
|
|
4
4
|
[](https://npmjs.org/package/loglevel-mixin)
|
|
5
5
|
[](https://github.com/arlac77/loglevel-mixin/issues)
|
|
6
|
-
[](https://actions-badge.atrox.dev/arlac77/loglevel-mixin/goto)
|
|
7
7
|
[](https://github.com/prettier/prettier)
|
|
8
8
|
[](http://commitizen.github.io/cz-cli/)
|
|
9
9
|
[](https://snyk.io/test/github/arlac77/loglevel-mixin)
|
|
@@ -56,22 +56,22 @@ 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
|
+
* [Logger](#logger)
|
|
60
|
+
* [Properties](#properties)
|
|
61
|
+
* [Loglevel](#loglevel)
|
|
62
|
+
* [Properties](#properties-1)
|
|
63
|
+
* [defaultLogLevels](#defaultloglevels)
|
|
64
|
+
* [declareLevels](#declarelevels)
|
|
65
|
+
* [Parameters](#parameters)
|
|
66
|
+
* [defineLoggerMethods](#defineloggermethods)
|
|
67
|
+
* [Parameters](#parameters-1)
|
|
68
|
+
* [Examples](#examples)
|
|
69
|
+
* [LOGLEVEL](#loglevel-1)
|
|
70
|
+
* [LogLevelMixin](#loglevelmixin)
|
|
71
|
+
* [Parameters](#parameters-2)
|
|
72
|
+
* [Examples](#examples-1)
|
|
73
|
+
* [makeLogEvent](#makelogevent)
|
|
74
|
+
* [Parameters](#parameters-3)
|
|
75
75
|
|
|
76
76
|
## Logger
|
|
77
77
|
|
|
@@ -79,7 +79,7 @@ Type: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Sta
|
|
|
79
79
|
|
|
80
80
|
### Properties
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
* `entry` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
83
83
|
|
|
84
84
|
## Loglevel
|
|
85
85
|
|
|
@@ -87,21 +87,21 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
|
|
|
87
87
|
|
|
88
88
|
### Properties
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
91
|
+
* `priority` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
92
92
|
|
|
93
93
|
## defaultLogLevels
|
|
94
94
|
|
|
95
95
|
default log levels
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
* trace
|
|
98
|
+
* debug
|
|
99
|
+
* info
|
|
100
|
+
* notice
|
|
101
|
+
* warn
|
|
102
|
+
* error
|
|
103
|
+
* crit
|
|
104
|
+
* alert
|
|
105
105
|
|
|
106
106
|
## declareLevels
|
|
107
107
|
|
|
@@ -109,7 +109,7 @@ Generate the loglevel objects out of a list of log level names.
|
|
|
109
109
|
|
|
110
110
|
### Parameters
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
* `list` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** A list of log level names. The last name in the list will become the one with the highest priority.
|
|
113
113
|
|
|
114
114
|
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** levels object a hash with all the loglevels. Stored by there name.
|
|
115
115
|
|
|
@@ -122,12 +122,12 @@ For each loglevel a method with the name of the log level will be created.
|
|
|
122
122
|
|
|
123
123
|
### Parameters
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
* `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** target where to assign properties to
|
|
126
|
+
* `logLevels` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Hash with all the available loglevels. Stored by there name (optional, default `defaultLogLevels`)
|
|
127
|
+
* `theFunction` **[Logger](#logger)** to be added under the loglevel name.
|
|
128
|
+
This function will only be called if the current loglevel is greater equal
|
|
129
|
+
the log level of the called logging function.
|
|
130
|
+
By default a method log(level,message) will be used
|
|
131
131
|
|
|
132
132
|
### Examples
|
|
133
133
|
|
|
@@ -149,9 +149,9 @@ symbol holding the actual logLevel inside of the target object
|
|
|
149
149
|
|
|
150
150
|
### Parameters
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
* `superclass` **class** class to be extendet
|
|
153
|
+
* `logLevels` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object with all the available loglevels. Stored by their name (optional, default `defaultLogLevels`)
|
|
154
|
+
* `initialLogLevel` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the default value for the logLevel property (optional, default `defaultLogLevels.info`)
|
|
155
155
|
|
|
156
156
|
### Examples
|
|
157
157
|
|
|
@@ -168,13 +168,13 @@ Returns **class** newly created class ready to be further extendet/used
|
|
|
168
168
|
|
|
169
169
|
## makeLogEvent
|
|
170
170
|
|
|
171
|
-
Helper function to aggregate values into a log event
|
|
171
|
+
Helper function to aggregate values into a log event.
|
|
172
172
|
|
|
173
173
|
### Parameters
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
* `severity` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** log severity
|
|
176
|
+
* `arg` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** original log message - level may be overwritten
|
|
177
|
+
* `args` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** additional values to be merged into the final log event - values have precedence
|
|
178
178
|
|
|
179
179
|
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** suitable for log event processing
|
|
180
180
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loglevel-mixin",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.6",
|
|
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.
|
|
34
|
-
"documentation": "
|
|
35
|
-
"semantic-release": "^
|
|
32
|
+
"ava": "^4.0.1",
|
|
33
|
+
"c8": "^7.11.0",
|
|
34
|
+
"documentation": "^13.2.5",
|
|
35
|
+
"semantic-release": "^19.0.2"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
|
-
"node": ">=
|
|
38
|
+
"node": ">=14.18.3"
|
|
39
39
|
},
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|
package/src/loglevel-mixin.mjs
CHANGED
|
@@ -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
|