zeddy-logger 1.0.9 → 1.0.10

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/index.cjs CHANGED
@@ -4,7 +4,7 @@ var LoggerBase = class {
4
4
  constructor(logOutputs) {
5
5
  this.logOutputs = logOutputs;
6
6
  }
7
- async log(logData) {
7
+ async baseLog(logData) {
8
8
  for (const logOutput of this.logOutputs) {
9
9
  if (!logOutput.transform) {
10
10
  await logOutput.log(logData);
@@ -41,28 +41,28 @@ var StandardLogger = class extends LoggerBase {
41
41
  super(logOutputs);
42
42
  }
43
43
  info(message, data) {
44
- this.log({
44
+ this.baseLog({
45
45
  tags: [LogLevel.info],
46
46
  data,
47
47
  message
48
48
  });
49
49
  }
50
50
  debug(message, data) {
51
- this.log({
51
+ this.baseLog({
52
52
  tags: [LogLevel.debug],
53
53
  data,
54
54
  message
55
55
  });
56
56
  }
57
57
  warning(message, data) {
58
- this.log({
58
+ this.baseLog({
59
59
  tags: [LogLevel.warning],
60
60
  data,
61
61
  message
62
62
  });
63
63
  }
64
64
  error(message, data) {
65
- this.log({
65
+ this.baseLog({
66
66
  tags: [LogLevel.error],
67
67
  data,
68
68
  message
package/dist/index.d.cts CHANGED
@@ -4,7 +4,7 @@ import { n as LogOutput, r as LogTag, t as LogData } from "./logger-types-CzUkAY
4
4
  declare class LoggerBase {
5
5
  private logOutputs;
6
6
  constructor(logOutputs: LogOutput[]);
7
- log(logData: LogData): Promise<void>;
7
+ baseLog(logData: LogData): Promise<void>;
8
8
  }
9
9
  //#endregion
10
10
  //#region src/standard-logger.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/logger-base.ts","../src/standard-logger.ts"],"sourcesContent":[],"mappings":";;;cAEa,UAAA;;EAAA,WAAA,CAAA,UAAU,EACW,SADX,EAAA;EACW,GAAA,CAAA,OAAA,EAEb,OAFa,CAAA,EAEN,OAFM,CAAA,IAAA,CAAA;;;;;cCOrB,cAAA,SAAuB,UAAA;0BACV"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/logger-base.ts","../src/standard-logger.ts"],"sourcesContent":[],"mappings":";;;cAEa,UAAA;;EAAA,WAAA,CAAA,UAAU,EACW,SADX,EAAA;EACW,OAAA,CAAA,OAAA,EAET,OAFS,CAAA,EAEF,OAFE,CAAA,IAAA,CAAA;;;;;cCOrB,cAAA,SAAuB,UAAA;0BACV"}
package/dist/index.d.mts CHANGED
@@ -4,7 +4,7 @@ import { n as LogOutput, r as LogTag, t as LogData } from "./logger-types-51ml81
4
4
  declare class LoggerBase {
5
5
  private logOutputs;
6
6
  constructor(logOutputs: LogOutput[]);
7
- log(logData: LogData): Promise<void>;
7
+ baseLog(logData: LogData): Promise<void>;
8
8
  }
9
9
  //#endregion
10
10
  //#region src/standard-logger.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/logger-base.ts","../src/standard-logger.ts"],"sourcesContent":[],"mappings":";;;cAEa,UAAA;;EAAA,WAAA,CAAA,UAAU,EACW,SADX,EAAA;EACW,GAAA,CAAA,OAAA,EAEb,OAFa,CAAA,EAEN,OAFM,CAAA,IAAA,CAAA;;;;;cCOrB,cAAA,SAAuB,UAAA;0BACV"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/logger-base.ts","../src/standard-logger.ts"],"sourcesContent":[],"mappings":";;;cAEa,UAAA;;EAAA,WAAA,CAAA,UAAU,EACW,SADX,EAAA;EACW,OAAA,CAAA,OAAA,EAET,OAFS,CAAA,EAEF,OAFE,CAAA,IAAA,CAAA;;;;;cCOrB,cAAA,SAAuB,UAAA;0BACV"}
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ var LoggerBase = class {
3
3
  constructor(logOutputs) {
4
4
  this.logOutputs = logOutputs;
5
5
  }
6
- async log(logData) {
6
+ async baseLog(logData) {
7
7
  for (const logOutput of this.logOutputs) {
8
8
  if (!logOutput.transform) {
9
9
  await logOutput.log(logData);
@@ -40,28 +40,28 @@ var StandardLogger = class extends LoggerBase {
40
40
  super(logOutputs);
41
41
  }
42
42
  info(message, data) {
43
- this.log({
43
+ this.baseLog({
44
44
  tags: [LogLevel.info],
45
45
  data,
46
46
  message
47
47
  });
48
48
  }
49
49
  debug(message, data) {
50
- this.log({
50
+ this.baseLog({
51
51
  tags: [LogLevel.debug],
52
52
  data,
53
53
  message
54
54
  });
55
55
  }
56
56
  warning(message, data) {
57
- this.log({
57
+ this.baseLog({
58
58
  tags: [LogLevel.warning],
59
59
  data,
60
60
  message
61
61
  });
62
62
  }
63
63
  error(message, data) {
64
- this.log({
64
+ this.baseLog({
65
65
  tags: [LogLevel.error],
66
66
  data,
67
67
  message
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["logOutputs: LogOutput[]"],"sources":["../src/logger-base.ts","../src/standard-logger.ts"],"sourcesContent":["import type {LogData, LogOutput} from './logger-types';\n\nexport class LoggerBase {\n constructor(private logOutputs: LogOutput[]) {}\n\n async log(logData: LogData) {\n for (const logOutput of this.logOutputs) {\n if (!logOutput.transform) {\n // no transform function, just log\n await logOutput.log(logData);\n continue;\n }\n // There is a transformation function\n // This might return null to prevent sending\n const transformedLogData = await logOutput.transform(logData);\n if (transformedLogData)\n await logOutput.log(transformedLogData);\n }\n }\n}\n","import {LoggerBase} from './logger-base';\nimport type {LogOutput} from './logger-types';\n\nexport const LogLevel = {\n info: {name: 'log-level', value: 'info'},\n debug: {name: 'log-level', value: 'debug'},\n warning: {name: 'log-level', value: 'warning'},\n error: {name: 'log-level', value: 'error'},\n};\n\nexport class StandardLogger extends LoggerBase {\n constructor(logOutputs: LogOutput[]) {\n super(logOutputs);\n }\n\n public info(message: string, data?: any) {\n void this.log({tags: [LogLevel.info], data, message});\n }\n\n public debug(message: string, data?: any) {\n void this.log({tags: [LogLevel.debug], data, message});\n }\n\n public warning(message: string, data?: any) {\n void this.log({tags: [LogLevel.warning], data, message});\n }\n\n public error(message: string, data?: any) {\n void this.log({tags: [LogLevel.error], data, message});\n }\n}\n"],"mappings":";AAEA,IAAa,aAAb,MAAwB;CACtB,YAAY,AAAQA,YAAyB;EAAzB;;CAEpB,MAAM,IAAI,SAAkB;AAC1B,OAAK,MAAM,aAAa,KAAK,YAAY;AACvC,OAAI,CAAC,UAAU,WAAW;AAExB,UAAM,UAAU,IAAI,QAAQ;AAC5B;;GAIF,MAAM,qBAAqB,MAAM,UAAU,UAAU,QAAQ;AAC7D,OAAI,mBACF,OAAM,UAAU,IAAI,mBAAmB;;;;;;;ACb/C,MAAa,WAAW;CACtB,MAAM;EAAC,MAAM;EAAa,OAAO;EAAO;CACxC,OAAO;EAAC,MAAM;EAAa,OAAO;EAAQ;CAC1C,SAAS;EAAC,MAAM;EAAa,OAAO;EAAU;CAC9C,OAAO;EAAC,MAAM;EAAa,OAAO;EAAQ;CAC3C;AAED,IAAa,iBAAb,cAAoC,WAAW;CAC7C,YAAY,YAAyB;AACnC,QAAM,WAAW;;CAGnB,AAAO,KAAK,SAAiB,MAAY;AACvC,EAAK,KAAK,IAAI;GAAC,MAAM,CAAC,SAAS,KAAK;GAAE;GAAM;GAAQ,CAAC;;CAGvD,AAAO,MAAM,SAAiB,MAAY;AACxC,EAAK,KAAK,IAAI;GAAC,MAAM,CAAC,SAAS,MAAM;GAAE;GAAM;GAAQ,CAAC;;CAGxD,AAAO,QAAQ,SAAiB,MAAY;AAC1C,EAAK,KAAK,IAAI;GAAC,MAAM,CAAC,SAAS,QAAQ;GAAE;GAAM;GAAQ,CAAC;;CAG1D,AAAO,MAAM,SAAiB,MAAY;AACxC,EAAK,KAAK,IAAI;GAAC,MAAM,CAAC,SAAS,MAAM;GAAE;GAAM;GAAQ,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["logOutputs: LogOutput[]"],"sources":["../src/logger-base.ts","../src/standard-logger.ts"],"sourcesContent":["import type {LogData, LogOutput} from './logger-types';\n\nexport class LoggerBase {\n constructor(private logOutputs: LogOutput[]) {}\n\n async baseLog(logData: LogData) {\n for (const logOutput of this.logOutputs) {\n if (!logOutput.transform) {\n // no transform function, just log\n await logOutput.log(logData);\n continue;\n }\n // There is a transformation function\n // This might return null to prevent sending\n const transformedLogData = await logOutput.transform(logData);\n if (transformedLogData)\n await logOutput.log(transformedLogData);\n }\n }\n}\n","import {LoggerBase} from './logger-base';\nimport type {LogOutput} from './logger-types';\n\nexport const LogLevel = {\n info: {name: 'log-level', value: 'info'},\n debug: {name: 'log-level', value: 'debug'},\n warning: {name: 'log-level', value: 'warning'},\n error: {name: 'log-level', value: 'error'},\n};\n\nexport class StandardLogger extends LoggerBase {\n constructor(logOutputs: LogOutput[]) {\n super(logOutputs);\n }\n\n public info(message: string, data?: any) {\n void this.baseLog({tags: [LogLevel.info], data, message});\n }\n\n public debug(message: string, data?: any) {\n void this.baseLog({tags: [LogLevel.debug], data, message});\n }\n\n public warning(message: string, data?: any) {\n void this.baseLog({tags: [LogLevel.warning], data, message});\n }\n\n public error(message: string, data?: any) {\n void this.baseLog({tags: [LogLevel.error], data, message});\n }\n}\n"],"mappings":";AAEA,IAAa,aAAb,MAAwB;CACtB,YAAY,AAAQA,YAAyB;EAAzB;;CAEpB,MAAM,QAAQ,SAAkB;AAC9B,OAAK,MAAM,aAAa,KAAK,YAAY;AACvC,OAAI,CAAC,UAAU,WAAW;AAExB,UAAM,UAAU,IAAI,QAAQ;AAC5B;;GAIF,MAAM,qBAAqB,MAAM,UAAU,UAAU,QAAQ;AAC7D,OAAI,mBACF,OAAM,UAAU,IAAI,mBAAmB;;;;;;;ACb/C,MAAa,WAAW;CACtB,MAAM;EAAC,MAAM;EAAa,OAAO;EAAO;CACxC,OAAO;EAAC,MAAM;EAAa,OAAO;EAAQ;CAC1C,SAAS;EAAC,MAAM;EAAa,OAAO;EAAU;CAC9C,OAAO;EAAC,MAAM;EAAa,OAAO;EAAQ;CAC3C;AAED,IAAa,iBAAb,cAAoC,WAAW;CAC7C,YAAY,YAAyB;AACnC,QAAM,WAAW;;CAGnB,AAAO,KAAK,SAAiB,MAAY;AACvC,EAAK,KAAK,QAAQ;GAAC,MAAM,CAAC,SAAS,KAAK;GAAE;GAAM;GAAQ,CAAC;;CAG3D,AAAO,MAAM,SAAiB,MAAY;AACxC,EAAK,KAAK,QAAQ;GAAC,MAAM,CAAC,SAAS,MAAM;GAAE;GAAM;GAAQ,CAAC;;CAG5D,AAAO,QAAQ,SAAiB,MAAY;AAC1C,EAAK,KAAK,QAAQ;GAAC,MAAM,CAAC,SAAS,QAAQ;GAAE;GAAM;GAAQ,CAAC;;CAG9D,AAAO,MAAM,SAAiB,MAAY;AACxC,EAAK,KAAK,QAAQ;GAAC,MAAM,CAAC,SAAS,MAAM;GAAE;GAAM;GAAQ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zeddy-logger",
3
3
  "type": "module",
4
- "version": "1.0.9",
4
+ "version": "1.0.10",
5
5
  "description": "Logging library for Node",
6
6
  "author": "Zlatibor Veljković",
7
7
  "license": "The Unlicense",