loglevel-mixin 7.0.1 → 7.0.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![npm](https://img.shields.io/npm/v/loglevel-mixin.svg)](https://www.npmjs.com/package/loglevel-mixin)
2
2
  [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
3
- [![Open Bundle](https://bundlejs.com/badge-light.svg)](https://bundlejs.com/?q=loglevel-mixin)
3
+ [![bundlejs](https://deno.bundlejs.com/?q=loglevel-mixin\&badge=detailed)](https://bundlejs.com/?q=loglevel-mixin)
4
4
  [![downloads](http://img.shields.io/npm/dm/loglevel-mixin.svg?style=flat-square)](https://npmjs.org/package/loglevel-mixin)
5
5
  [![GitHub Issues](https://img.shields.io/github/issues/arlac77/loglevel-mixin.svg?style=flat-square)](https://github.com/arlac77/loglevel-mixin/issues)
6
6
  [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Floglevel-mixin%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/loglevel-mixin/goto)
@@ -123,7 +123,7 @@ For each loglevel a method with the name of the log level will be created.
123
123
 
124
124
  * `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** target where to assign properties to
125
125
  * `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`)
126
- * `theFunction` **[Logger](#logger)** to be added under the loglevel name.
126
+ * `theFunction` **[Logger](#logger)?** to be added under the loglevel name.
127
127
  This function will only be called if the current loglevel is greater equal
128
128
  the log level of the called logging function.
129
129
  By default a method log(level,message) will be used
@@ -144,9 +144,9 @@ Returns **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Referenc
144
144
 
145
145
  ### Parameters
146
146
 
147
- * `superclass` **class** class to be extendet
147
+ * `superclass` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** class to be extendet
148
148
  * `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`)
149
- * `initialLogLevel` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the default value for the logLevel property (optional, default `defaultLogLevels.info`)
149
+ * `initialLogLevel` **[Loglevel](#loglevel)** the default value for the logLevel property (optional, default `defaultLogLevels.info`)
150
150
 
151
151
  ### Examples
152
152
 
@@ -159,7 +159,7 @@ class LoggingEnabledClass extends LogLevelMixin(BaseClass) {
159
159
  }
160
160
  ```
161
161
 
162
- Returns **class** newly created class ready to be further extendet/used
162
+ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** newly created class ready to be further extendet/used
163
163
 
164
164
  ## makeLogEvent
165
165
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loglevel-mixin",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -29,14 +29,14 @@
29
29
  "lint:docs": "documentation lint ./src/**/*.mjs"
30
30
  },
31
31
  "devDependencies": {
32
- "ava": "^5.2.0",
33
- "browser-ava": "^1.3.27",
34
- "c8": "^7.13.0",
35
- "documentation": "^14.0.1",
36
- "semantic-release": "^20.1.3"
32
+ "ava": "^5.3.1",
33
+ "browser-ava": "^1.3.57",
34
+ "c8": "^8.0.1",
35
+ "documentation": "^14.0.2",
36
+ "semantic-release": "^21.1.1"
37
37
  },
38
38
  "engines": {
39
- "node": ">=16.19.1"
39
+ "node": ">=16.20.2"
40
40
  },
41
41
  "repository": {
42
42
  "type": "git",
@@ -49,7 +49,7 @@ export function declareLevels(list) {
49
49
  * For each loglevel a method with the name of the log level will be created.
50
50
  * @param {Object} object target where to assign properties to
51
51
  * @param {Object} logLevels Hash with all the available loglevels. Stored by there name
52
- * @param {Logger} theFunction to be added under the loglevel name.
52
+ * @param {Logger} [theFunction] to be added under the loglevel name.
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
@@ -105,10 +105,10 @@ export function defineLoggerMethods(
105
105
  * <!-- skip-example -->
106
106
  * @class
107
107
  * @classdesc This function is a mixin for ES2015 classes.
108
- * @param {class} superclass class to be extendet
108
+ * @param {Object} superclass class to be extendet
109
109
  * @param {Object} logLevels Object with all the available loglevels. Stored by their name
110
- * @param {string} initialLogLevel the default value for the logLevel property
111
- * @return {class} newly created class ready to be further extendet/used
110
+ * @param {Loglevel} initialLogLevel the default value for the logLevel property
111
+ * @return {Object} newly created class ready to be further extendet/used
112
112
  * @example
113
113
  * import { LogLevelMixin } = from 'loglevel-mixin';
114
114
  * class BaseClass {
@@ -173,7 +173,9 @@ export function makeLogEvent(severity, arg, args) {
173
173
  }
174
174
 
175
175
  const logevent = {
176
- severity
176
+ severity,
177
+ ...arg,
178
+ ...args
177
179
  };
178
180
 
179
181
  if (arg instanceof Error) {
@@ -182,7 +184,7 @@ export function makeLogEvent(severity, arg, args) {
182
184
  mapError(logevent, arg.error);
183
185
  }
184
186
 
185
- return Object.assign(logevent, arg, args);
187
+ return logevent;
186
188
  }
187
189
  }
188
190