@imqueue/async-logger 1.3.0 → 1.3.1

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/README.md CHANGED
@@ -14,20 +14,20 @@ There are two actual ways of using async logger.
14
14
 
15
15
  1. Rely on singleton instance produced by this library, which is configured by
16
16
  environment variables (see Configuration section below)
17
-
17
+
18
18
  In this case as simple as
19
19
  ~~~typescript
20
- import logger from '@imqueue/async-async-logger';
21
-
20
+ import logger from '@imqueue/async-logger';
21
+
22
22
  serviceOptions.logger = logger;
23
23
  ~~~
24
24
 
25
25
  2. Instantiate and configure async logger programmatically:
26
26
  ~~~typescript
27
- import { Logger } from '@imqueue/async-async-logger';
28
-
27
+ import { Logger } from '@imqueue/async-logger';
28
+
29
29
  const { name, version } = require('./package.json');
30
-
30
+
31
31
  const logger = new Logger({
32
32
  transports: [{
33
33
  type: 'http',
@@ -48,7 +48,7 @@ There are two actual ways of using async logger.
48
48
  hostname: 'localhost'
49
49
  },
50
50
  });
51
-
51
+
52
52
  serviceOptions.logger = logger;
53
53
  ~~~
54
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imqueue/async-logger",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Configurable async logger over winston for @imqueue services",
5
5
  "keywords": [
6
6
  "logger",
package/src/Logger.js CHANGED
@@ -109,8 +109,8 @@ exports.Logger = Logger;
109
109
  */
110
110
  Logger.console = {
111
111
  log: (...args) => setTimeout(() => console.log(...args)),
112
- info: (...args) => setTimeout(() => console.log(...args)),
113
- warn: (...args) => setTimeout(() => console.log(...args)),
114
- error: (...args) => setTimeout(() => console.log(...args)),
112
+ info: (...args) => setTimeout(() => console.info(...args)),
113
+ warn: (...args) => setTimeout(() => console.warn(...args)),
114
+ error: (...args) => setTimeout(() => console.error(...args)),
115
115
  };
116
116
  //# sourceMappingURL=Logger.js.map
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultMetadata = exports.transportsConfig = exports.pkg = void 0;
3
+ exports.pkg = pkg;
4
+ exports.transportsConfig = transportsConfig;
5
+ exports.defaultMetadata = defaultMetadata;
4
6
  const path_1 = require("path");
5
7
  const fs_1 = require("fs");
6
8
  const RX_NAME = /%name/g;
@@ -17,7 +19,6 @@ function pkg() {
17
19
  : { name: 'logger', version: '' };
18
20
  return { name, version };
19
21
  }
20
- exports.pkg = pkg;
21
22
  /**
22
23
  * Used for retrieve transport config from environment variables
23
24
  *
@@ -34,7 +35,6 @@ function transportsConfig() {
34
35
  throw new TypeError(`Logger: can not parse transports config: ${err.stack ? err.stack : err.message}`);
35
36
  }
36
37
  }
37
- exports.transportsConfig = transportsConfig;
38
38
  /**
39
39
  * Returns default metadata, configured by environment variables
40
40
  *
@@ -51,5 +51,4 @@ function defaultMetadata() {
51
51
  throw new TypeError(`Logger: can not parse metadata: ${err.stack ? err.stack : err.message}`);
52
52
  }
53
53
  }
54
- exports.defaultMetadata = defaultMetadata;
55
54
  //# sourceMappingURL=env.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildMessage = void 0;
3
+ exports.buildMessage = buildMessage;
4
4
  /*!
5
5
  * Copyright (c) 2018, imqueue.com <support@imqueue.com>
6
6
  *
@@ -26,5 +26,4 @@ const util_1 = require("util");
26
26
  function buildMessage(args) {
27
27
  return (0, util_1.format)(args.shift(), ...args);
28
28
  }
29
- exports.buildMessage = buildMessage;
30
29
  //# sourceMappingURL=message.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTransport = void 0;
3
+ exports.getTransport = getTransport;
4
4
  /*!
5
5
  * Copyright (c) 2018, imqueue.com <support@imqueue.com>
6
6
  *
@@ -35,5 +35,4 @@ function getTransport(type, options) {
35
35
  }
36
36
  return transportInstance;
37
37
  }
38
- exports.getTransport = getTransport;
39
38
  //# sourceMappingURL=transport.js.map