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 CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015-2021 by Markus Felten
1
+ Copyright (c) 2015-2022 by Markus Felten
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
package/README.md CHANGED
@@ -56,22 +56,28 @@ npm install loglevel-mixin
56
56
 
57
57
  ### Table of Contents
58
58
 
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)
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.4",
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": "^3.15.0",
33
- "c8": "^7.7.3",
32
+ "ava": "^4.0.1",
33
+ "c8": "^7.11.0",
34
34
  "documentation": "^13.2.5",
35
- "semantic-release": "^17.4.3"
35
+ "semantic-release": "^19.0.2"
36
36
  },
37
37
  "engines": {
38
- "node": ">=14.17.1"
38
+ "node": ">=14.18.3"
39
39
  },
40
40
  "repository": {
41
41
  "type": "git",
@@ -74,24 +74,24 @@ export function defineLoggerMethods(
74
74
  {
75
75
  value:
76
76
  theFunction === undefined
77
- ? function(providerFunction) {
77
+ ? function(arg,...args) {
78
78
  if (this.logLevelPriority >= priority) {
79
79
  this.log(
80
80
  name,
81
- typeof providerFunction === "function"
82
- ? providerFunction(name)
83
- : providerFunction
81
+ typeof arg === "function"
82
+ ? arg(name)
83
+ : arg, ...args
84
84
  );
85
85
  }
86
86
  }
87
- : function(providerFunction) {
87
+ : function(arg,...args) {
88
88
  if (this.logLevelPriority >= priority) {
89
89
  theFunction.call(
90
90
  this,
91
91
  name,
92
- typeof providerFunction === "function"
93
- ? providerFunction(name)
94
- : providerFunction
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