@quatrain/log 0.1.4 → 1.0.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.
@@ -16,6 +16,9 @@ class AbstractLoggerAdapter {
16
16
  this._logLevel = Log_1.LogLevel.WARN;
17
17
  this._logger = undefined;
18
18
  this.formatLogMessage = (messages, loglevel = 3) => {
19
+ if (!Array.isArray(messages)) {
20
+ messages = [messages];
21
+ }
19
22
  messages.unshift(`${Log_1.Log.timestamp()} - [${this._me}]`);
20
23
  const strs = messages.map((message) => {
21
24
  return typeof message !== 'object' ? message : JSON.stringify(message);
@@ -32,11 +35,23 @@ class AbstractLoggerAdapter {
32
35
  * @param message string | object
33
36
  * @param level string
34
37
  */
35
- log(...messages) { }
36
- debug(message) { }
37
- warn(message) { }
38
- info(message) { }
39
- error(message) { }
40
- trace(message) { }
38
+ log(...messages) {
39
+ throw new Error(`This method needs to be implemtend in child class`);
40
+ }
41
+ debug(message) {
42
+ throw new Error(`This method needs to be implemtend in child class`);
43
+ }
44
+ warn(message) {
45
+ throw new Error(`This method needs to be implemtend in child class`);
46
+ }
47
+ info(message) {
48
+ throw new Error(`This method needs to be implemtend in child class`);
49
+ }
50
+ error(message) {
51
+ throw new Error(`This method needs to be implemtend in child class`);
52
+ }
53
+ trace(message) {
54
+ throw new Error(`This method needs to be implemtend in child class`);
55
+ }
41
56
  }
42
57
  exports.AbstractLoggerAdapter = AbstractLoggerAdapter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatrain/log",
3
- "version": "0.1.4",
3
+ "version": "1.0.2",
4
4
  "description": "Logger for business apps",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",