@oino-ts/common 0.10.3 → 0.11.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/dist/cjs/OINOLog.js +14 -3
- package/dist/esm/OINOLog.js +14 -3
- package/dist/types/OINOLog.d.ts +8 -1
- package/package.json +4 -2
- package/src/OINOLog.ts +15 -3
package/dist/cjs/OINOLog.js
CHANGED
|
@@ -186,14 +186,13 @@ class OINOLog {
|
|
|
186
186
|
return result;
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
|
-
*
|
|
189
|
+
* Set log levels from an array of objects with domain, channel, method and level overwriting existing values (i.e. non-existing values are not affected).
|
|
190
190
|
*
|
|
191
191
|
* @param logLevels array of log level objects
|
|
192
192
|
*
|
|
193
193
|
*/
|
|
194
|
-
static
|
|
194
|
+
static setLogLevels(logLevels) {
|
|
195
195
|
if (OINOLog._instance) {
|
|
196
|
-
OINOLog._instance._logLevels = { "||": OINOLog._instance._defaultLogLevel }; // reset to default log level
|
|
197
196
|
for (const logLevel of logLevels) {
|
|
198
197
|
const domain = logLevel.domain || "";
|
|
199
198
|
const channel = logLevel.channel || "";
|
|
@@ -205,6 +204,18 @@ class OINOLog {
|
|
|
205
204
|
}
|
|
206
205
|
}
|
|
207
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Import log levels from an array of objects with domain, channel, method and level resetting existing values (i.e. non-existing values get removed).
|
|
209
|
+
*
|
|
210
|
+
* @param logLevels array of log level objects
|
|
211
|
+
*
|
|
212
|
+
*/
|
|
213
|
+
static importLogLevels(logLevels) {
|
|
214
|
+
if (OINOLog._instance) {
|
|
215
|
+
OINOLog._instance._logLevels = { "||": OINOLog._instance._defaultLogLevel }; // reset to default log level
|
|
216
|
+
this.setLogLevels(logLevels);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
208
219
|
}
|
|
209
220
|
exports.OINOLog = OINOLog;
|
|
210
221
|
/**
|
package/dist/esm/OINOLog.js
CHANGED
|
@@ -183,14 +183,13 @@ export class OINOLog {
|
|
|
183
183
|
return result;
|
|
184
184
|
}
|
|
185
185
|
/**
|
|
186
|
-
*
|
|
186
|
+
* Set log levels from an array of objects with domain, channel, method and level overwriting existing values (i.e. non-existing values are not affected).
|
|
187
187
|
*
|
|
188
188
|
* @param logLevels array of log level objects
|
|
189
189
|
*
|
|
190
190
|
*/
|
|
191
|
-
static
|
|
191
|
+
static setLogLevels(logLevels) {
|
|
192
192
|
if (OINOLog._instance) {
|
|
193
|
-
OINOLog._instance._logLevels = { "||": OINOLog._instance._defaultLogLevel }; // reset to default log level
|
|
194
193
|
for (const logLevel of logLevels) {
|
|
195
194
|
const domain = logLevel.domain || "";
|
|
196
195
|
const channel = logLevel.channel || "";
|
|
@@ -202,6 +201,18 @@ export class OINOLog {
|
|
|
202
201
|
}
|
|
203
202
|
}
|
|
204
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Import log levels from an array of objects with domain, channel, method and level resetting existing values (i.e. non-existing values get removed).
|
|
206
|
+
*
|
|
207
|
+
* @param logLevels array of log level objects
|
|
208
|
+
*
|
|
209
|
+
*/
|
|
210
|
+
static importLogLevels(logLevels) {
|
|
211
|
+
if (OINOLog._instance) {
|
|
212
|
+
OINOLog._instance._logLevels = { "||": OINOLog._instance._defaultLogLevel }; // reset to default log level
|
|
213
|
+
this.setLogLevels(logLevels);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
205
216
|
}
|
|
206
217
|
/**
|
|
207
218
|
* Logging implementation based on console.log.
|
package/dist/types/OINOLog.d.ts
CHANGED
|
@@ -134,7 +134,14 @@ export declare abstract class OINOLog {
|
|
|
134
134
|
*/
|
|
135
135
|
static exportLogLevels(): any[];
|
|
136
136
|
/**
|
|
137
|
-
*
|
|
137
|
+
* Set log levels from an array of objects with domain, channel, method and level overwriting existing values (i.e. non-existing values are not affected).
|
|
138
|
+
*
|
|
139
|
+
* @param logLevels array of log level objects
|
|
140
|
+
*
|
|
141
|
+
*/
|
|
142
|
+
static setLogLevels(logLevels: any[]): void;
|
|
143
|
+
/**
|
|
144
|
+
* Import log levels from an array of objects with domain, channel, method and level resetting existing values (i.e. non-existing values get removed).
|
|
138
145
|
*
|
|
139
146
|
* @param logLevels array of log level objects
|
|
140
147
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oino-ts/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "OINO TS package for common classes.",
|
|
5
5
|
"author": "Matias Kiviniemi (pragmatta)",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@oino-ts/types": "0.
|
|
22
|
+
"@oino-ts/types": "0.11.0",
|
|
23
|
+
"@types/node": "^22.0.0",
|
|
24
|
+
"typescript": "~5.9.0"
|
|
23
25
|
},
|
|
24
26
|
"files": [
|
|
25
27
|
"src/*.ts",
|
package/src/OINOLog.ts
CHANGED
|
@@ -213,14 +213,13 @@ export abstract class OINOLog {
|
|
|
213
213
|
|
|
214
214
|
|
|
215
215
|
/**
|
|
216
|
-
*
|
|
216
|
+
* Set log levels from an array of objects with domain, channel, method and level overwriting existing values (i.e. non-existing values are not affected).
|
|
217
217
|
*
|
|
218
218
|
* @param logLevels array of log level objects
|
|
219
219
|
*
|
|
220
220
|
*/
|
|
221
|
-
static
|
|
221
|
+
static setLogLevels(logLevels:any[]):void {
|
|
222
222
|
if (OINOLog._instance) {
|
|
223
|
-
OINOLog._instance._logLevels = {"||": OINOLog._instance._defaultLogLevel} // reset to default log level
|
|
224
223
|
for (const logLevel of logLevels) {
|
|
225
224
|
const domain = logLevel.domain || ""
|
|
226
225
|
const channel = logLevel.channel || ""
|
|
@@ -232,6 +231,19 @@ export abstract class OINOLog {
|
|
|
232
231
|
}
|
|
233
232
|
}
|
|
234
233
|
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Import log levels from an array of objects with domain, channel, method and level resetting existing values (i.e. non-existing values get removed).
|
|
237
|
+
*
|
|
238
|
+
* @param logLevels array of log level objects
|
|
239
|
+
*
|
|
240
|
+
*/
|
|
241
|
+
static importLogLevels(logLevels:any[]):void {
|
|
242
|
+
if (OINOLog._instance) {
|
|
243
|
+
OINOLog._instance._logLevels = {"||": OINOLog._instance._defaultLogLevel} // reset to default log level
|
|
244
|
+
this.setLogLevels(logLevels)
|
|
245
|
+
}
|
|
246
|
+
}
|
|
235
247
|
}
|
|
236
248
|
|
|
237
249
|
/**
|