zeddemore-logger 2.2.3 → 2.2.5

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.
@@ -748,6 +748,7 @@ class ZeddemoreLogger extends ZeddemoreBase {
748
748
  * Log server listening information
749
749
  * @param {Object} options
750
750
  * @param {String} [options.environment]
751
+ * @param {String} [options.listenHost]
751
752
  * @param {String} [options.instance]
752
753
  * @param {String} [options.name]
753
754
  * @param {number} [options.port]
@@ -756,15 +757,20 @@ class ZeddemoreLogger extends ZeddemoreBase {
756
757
  */
757
758
  #logServerListening = (options, logLevel = wll.INFO) => {
758
759
  const serverEnvironment = options.environment || this.serverEnvironment;
760
+ const serverHost = options.listenHost || defaults.listenHost;
759
761
  const serverInstance = options.instance || this.serverInstance;
760
762
  const serverName = options.name || this.serverName;
761
763
  const serverPort = options.port || this.serverPort;
764
+ const usingIPv4 = true;
765
+ const usingIPv6 = _.isString(serverHost) && serverHost.includes(defaults.listenHostIPv6Sentinel);
766
+ const ipVs = _.compact([ (usingIPv4 ? 'IPv4' : null), (usingIPv6 ? chalk.red('IPv6') : null) ]).join('/');
762
767
  const msgParts = [ ];
763
768
  const serverParts = [ serverName ];
764
769
  if (serverEnvironment) serverParts.push(serverEnvironment);
765
770
  if (serverInstance) serverParts.push(serverInstance);
766
771
  msgParts.push(`[${ serverParts.join(':') }]`);
767
- msgParts.push(`Node.js Express server listening on port ${ chalk.bold(serverPort) }`);
772
+ msgParts.push(`Node.js Express server listening on ${ serverHost }:${ chalk.bold(serverPort) }`);
773
+ msgParts.push(`(${ ipVs })`);
768
774
  this.log(logLevel)(msgParts.join(' '));
769
775
  }
770
776
 
package/lib/defaults.js CHANGED
@@ -12,7 +12,9 @@ module.exports = {
12
12
  consoleDirExtensionDepth: null,
13
13
  consoleDirExtensionShowHidden: true,
14
14
  contentLengthDigits: 2,
15
- liveMessage: '⚡live⚡',
15
+ listenHost: '::',
16
+ listenHostIPv6Sentinel: ':',
17
+ liveMessage: 'live',
16
18
  logLevelType: llt.CONSOLE,
17
19
  morganFormat: mf.ZEDDEMORE,
18
20
  morganFormatTokens: [ mft.METHOD, mft.DECODED_URL, mft.STATUS, mft.RESPONSE_TIME_FORMAT, mft.CONTENT_LENGTH_FORMAT ],
package/lib/enums.js CHANGED
@@ -58,6 +58,7 @@ const hexColors = {
58
58
  PACKAGE_JIMP: '#FF0000',
59
59
  PACKAGE_MYSQL: '#00618A',
60
60
  PACKAGE_NODE_JS: '#689F63',
61
+ PACKAGE_NODEMAILER: '#29ABE2',
61
62
  PACKAGE_PASSPORT: '#51E492',
62
63
  PACKAGE_PDFKIT: '#DB000D',
63
64
  PACKAGE_POSTGRESQL: '#336791',
@@ -43,6 +43,7 @@ const packageColors = [
43
43
  { match: 'Jimp', style: { format: cf.HEX, fore: hc.PACKAGE_JIMP, back: null } },
44
44
  { match: 'MySQL', style: { format: cf.HEX, fore: hc.PACKAGE_MYSQL, back: null } },
45
45
  { match: 'Node.js', style: { format: cf.HEX, fore: hc.PACKAGE_NODE_JS, back: null } },
46
+ { match: 'Nodemailer', style: { format: cf.HEX, fore: hc.PACKAGE_NODEMAILER, back: null } },
46
47
  { match: 'passport', style: { format: cf.HEX, fore: hc.PACKAGE_PASSPORT, back: null } },
47
48
  { match: 'PDFKit', style: { format: cf.HEX, fore: hc.PACKAGE_PDFKIT, back: null } },
48
49
  { match: 'PostgreSQL', style: { format: cf.HEX, fore: hc.PACKAGE_POSTGRESQL, back: null } },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zeddemore-logger",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "Node.js Express logger using Morgan and Winston for thread and caller info tracking",
5
5
  "repository": {
6
6
  "type": "git",