@oino-ts/common 0.15.0 → 0.15.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.
@@ -161,8 +161,8 @@ class OINOMemoryBenchmark extends OINOBenchmark {
161
161
  const name = module + "." + method;
162
162
  let result = 0;
163
163
  if (OINOBenchmark._enabled[module] && (this._benchmarkStart[name] > 0)) { // if benchmark is started, end it
164
- this._benchmarkStart[name] = 0;
165
164
  const duration = performance.now() - this._benchmarkStart[name];
165
+ this._benchmarkStart[name] = 0;
166
166
  this._trackMetric(module, method, duration);
167
167
  }
168
168
  return;
@@ -56,9 +56,7 @@ class OINOLog {
56
56
  const log_levels = OINOLog._instance._logLevels;
57
57
  // console.log(log_levels)
58
58
  const min_level = log_levels[domain + "|" + channel + "|" + method] ||
59
- log_levels[domain + "||" + method] ||
60
59
  log_levels[domain + "|" + channel + "|"] ||
61
- log_levels["|" + channel + "|"] ||
62
60
  log_levels[domain + "||"] ||
63
61
  log_levels["||"];
64
62
  // console.log("_log: level=" + level + ", min_level=" + min_level + ", levelStr=" + levelStr + ", message=" + message, data)
@@ -157,8 +157,8 @@ export class OINOMemoryBenchmark extends OINOBenchmark {
157
157
  const name = module + "." + method;
158
158
  let result = 0;
159
159
  if (OINOBenchmark._enabled[module] && (this._benchmarkStart[name] > 0)) { // if benchmark is started, end it
160
- this._benchmarkStart[name] = 0;
161
160
  const duration = performance.now() - this._benchmarkStart[name];
161
+ this._benchmarkStart[name] = 0;
162
162
  this._trackMetric(module, method, duration);
163
163
  }
164
164
  return;
@@ -53,9 +53,7 @@ export class OINOLog {
53
53
  const log_levels = OINOLog._instance._logLevels;
54
54
  // console.log(log_levels)
55
55
  const min_level = log_levels[domain + "|" + channel + "|" + method] ||
56
- log_levels[domain + "||" + method] ||
57
56
  log_levels[domain + "|" + channel + "|"] ||
58
- log_levels["|" + channel + "|"] ||
59
57
  log_levels[domain + "||"] ||
60
58
  log_levels["||"];
61
59
  // console.log("_log: level=" + level + ", min_level=" + min_level + ", levelStr=" + levelStr + ", message=" + message, data)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oino-ts/common",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "OINO TS package for common classes.",
5
5
  "author": "Matias Kiviniemi (pragmatta)",
6
6
  "license": "MPL-2.0",
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  },
21
21
  "devDependencies": {
22
- "@oino-ts/types": "0.15.0",
22
+ "@oino-ts/types": "0.15.2",
23
23
  "@types/node": "^22.0.0",
24
24
  "typescript": "~5.9.0"
25
25
  },
@@ -185,8 +185,8 @@ export class OINOMemoryBenchmark extends OINOBenchmark {
185
185
  const name:string = module + "." + method
186
186
  let result:number = 0
187
187
  if (OINOBenchmark._enabled[module] && (this._benchmarkStart[name] > 0)) { // if benchmark is started, end it
188
- this._benchmarkStart[name] = 0
189
188
  const duration = performance.now() - this._benchmarkStart[name]
189
+ this._benchmarkStart[name] = 0
190
190
  this._trackMetric(module, method, duration)
191
191
  }
192
192
  return
package/src/OINOLog.ts CHANGED
@@ -72,10 +72,9 @@ export abstract class OINOLog {
72
72
  if (OINOLog._instance) {
73
73
  const log_levels = OINOLog._instance._logLevels
74
74
  // console.log(log_levels)
75
- const min_level = log_levels[domain + "|" + channel + "|" + method] ||
76
- log_levels[domain + "||" + method] ||
75
+ const min_level =
76
+ log_levels[domain + "|" + channel + "|" + method] ||
77
77
  log_levels[domain + "|" + channel + "|"] ||
78
- log_levels["|" + channel + "|"] ||
79
78
  log_levels[domain + "||"] ||
80
79
  log_levels["||"]
81
80
  // console.log("_log: level=" + level + ", min_level=" + min_level + ", levelStr=" + levelStr + ", message=" + message, data)
@@ -94,7 +93,7 @@ export abstract class OINOLog {
94
93
  static setInstance(instance: OINOLog) {
95
94
  // console.log("setLogger: " + log)
96
95
  if (instance) {
97
- OINOLog._instance = instance
96
+ OINOLog._instance = instance
98
97
  }
99
98
  }
100
99