@ancon/wildcat-utils 1.31.0 → 1.31.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.
@@ -2,8 +2,8 @@ import { LogStrategy } from './types';
2
2
  declare class Logger {
3
3
  protected logStrategy: LogStrategy;
4
4
  constructor(logStrategy: LogStrategy);
5
- private format;
6
- private sanitize;
5
+ protected format<T = unknown>(data?: T): unknown;
6
+ protected sanitize<T = unknown>(data?: T): unknown;
7
7
  setLogStrategy(logStrategy: LogStrategy): void;
8
8
  verbose<T = unknown>(message: string, data?: T): void;
9
9
  debug<T = unknown>(message: string, data?: T): void;
package/logger/Logger.js CHANGED
@@ -1 +1 @@
1
- "use strict";const i=require("./types.js");class g{constructor(t){this.logStrategy=t}format(t){return this.logStrategy.format?this.logStrategy.format(t):t}sanitize(t){return this.logStrategy.sanitize?this.logStrategy.sanitize(t):t}setLogStrategy(t){this.logStrategy=t}verbose(t,e){this.logStrategy.execute(i.LogLevel.Verbose,t,this.sanitize(e))}debug(t,e){this.logStrategy.execute(i.LogLevel.Debug,t,this.sanitize(e))}info(t,e){this.logStrategy.execute(i.LogLevel.Information,t,this.sanitize(e))}warn(t,e){this.logStrategy.execute(i.LogLevel.Warning,t,this.sanitize(e))}error(t,e,r){this.logStrategy.execute(i.LogLevel.Error,t,this.format(this.sanitize(e)),r)}fatal(t,e){this.logStrategy.execute(i.LogLevel.Fatal,t,this.sanitize(e))}}module.exports=g;
1
+ "use strict";const i=require("./types.js");class s{constructor(t){this.logStrategy=t}format(t){return this.logStrategy.format?this.logStrategy.format(t):t}sanitize(t){return this.logStrategy.sanitize?this.logStrategy.sanitize(t):t}setLogStrategy(t){this.logStrategy=t}verbose(t,e){this.logStrategy.execute(i.LogLevel.Verbose,t,this.format(this.sanitize(e)))}debug(t,e){this.logStrategy.execute(i.LogLevel.Debug,t,this.format(this.sanitize(e)))}info(t,e){this.logStrategy.execute(i.LogLevel.Information,t,this.format(this.sanitize(e)))}warn(t,e){this.logStrategy.execute(i.LogLevel.Warning,t,this.format(this.sanitize(e)))}error(t,e,r){this.logStrategy.execute(i.LogLevel.Error,t,this.format(this.sanitize(e)),r)}fatal(t,e){this.logStrategy.execute(i.LogLevel.Fatal,t,this.format(this.sanitize(e)))}}module.exports=s;
package/logger/Logger.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LogLevel as i } from "./types.mjs";
2
- class g {
2
+ class o {
3
3
  constructor(t) {
4
4
  this.logStrategy = t;
5
5
  }
@@ -13,20 +13,32 @@ class g {
13
13
  this.logStrategy = t;
14
14
  }
15
15
  verbose(t, e) {
16
- this.logStrategy.execute(i.Verbose, t, this.sanitize(e));
16
+ this.logStrategy.execute(
17
+ i.Verbose,
18
+ t,
19
+ this.format(this.sanitize(e))
20
+ );
17
21
  }
18
22
  debug(t, e) {
19
- this.logStrategy.execute(i.Debug, t, this.sanitize(e));
23
+ this.logStrategy.execute(
24
+ i.Debug,
25
+ t,
26
+ this.format(this.sanitize(e))
27
+ );
20
28
  }
21
29
  info(t, e) {
22
30
  this.logStrategy.execute(
23
31
  i.Information,
24
32
  t,
25
- this.sanitize(e)
33
+ this.format(this.sanitize(e))
26
34
  );
27
35
  }
28
36
  warn(t, e) {
29
- this.logStrategy.execute(i.Warning, t, this.sanitize(e));
37
+ this.logStrategy.execute(
38
+ i.Warning,
39
+ t,
40
+ this.format(this.sanitize(e))
41
+ );
30
42
  }
31
43
  error(t, e, r) {
32
44
  this.logStrategy.execute(
@@ -37,9 +49,13 @@ class g {
37
49
  );
38
50
  }
39
51
  fatal(t, e) {
40
- this.logStrategy.execute(i.Fatal, t, this.sanitize(e));
52
+ this.logStrategy.execute(
53
+ i.Fatal,
54
+ t,
55
+ this.format(this.sanitize(e))
56
+ );
41
57
  }
42
58
  }
43
59
  export {
44
- g as default
60
+ o as default
45
61
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancon/wildcat-utils",
3
- "version": "1.31.0",
3
+ "version": "1.31.2",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",