🪵 Logger scaffold

This commit is contained in:
2021-09-16 14:46:01 -07:00
parent 16d9b50f21
commit a74ac6464f
7 changed files with 168 additions and 223 deletions

View File

@@ -1,5 +1,10 @@
"use strict";
import {BrokerOptions, Errors, MetricRegistry, ServiceBroker} from "moleculer";
import {
BrokerOptions,
Errors,
MetricRegistry,
ServiceBroker,
} from "moleculer";
/**
* Moleculer ServiceBroker configuration file
@@ -36,21 +41,33 @@ const brokerConfig: BrokerOptions = {
// Enable/disable logging or use custom logger. More info: https://moleculer.services/docs/0.14/logging.html
// Available logger types: "Console", "File", "Pino", "Winston", "Bunyan", "debug", "Log4js", "Datadog"
logger: {
type: "Console",
options: {
// Using colors on the output
colors: true,
// Print module names with different colors (like docker-compose for containers)
moduleColors: false,
// Line formatter. It can be "json", "short", "simple", "full", a `Function` or a template string like "{timestamp} {level} {nodeID}/{mod}: {msg}"
formatter: "full",
// Custom object printer. If not defined, it uses the `util.inspect` method.
objectPrinter: null,
// Auto-padding the module name in order to messages begin at the same column.
autoPadding: false,
logger: [
{
type: "Console",
options: {
level: "info",
},
},
},
{
type: "File",
options: {
level: "debug",
folder: "./logs",
filename: "threetwo-import-service.log",
// Using colors on the output
colors: true,
// Print module names with different colors (like docker-compose for containers)
moduleColors: false,
// Line formatter. It can be "json", "short", "simple", "full", a `Function` or a template string like "{timestamp} {level} {nodeID}/{mod}: {msg}"
formatter: "json",
// Custom object printer. If not defined, it uses the `util.inspect` method.
objectPrinter: null,
eol: "\n",
// Auto-padding the module name in order to messages begin at the same column.
autoPadding: true,
},
},
],
// Default log level for built-in console logger. It can be overwritten in logger options above.
// Available values: trace, debug, info, warn, error, fatal
logLevel: "info",
@@ -63,7 +80,7 @@ const brokerConfig: BrokerOptions = {
// Define a cacher.
// More info: https://moleculer.services/docs/0.14/caching.html
cacher: "Memory",
cacher: "Memory",
// Define a serializer.
// Available values: "JSON", "Avro", "ProtoBuf", "MsgPack", "Notepack", "Thrift".
@@ -180,12 +197,12 @@ const brokerConfig: BrokerOptions = {
options: {
// Custom logger
logger: null,
// Using colors
colors: true,
// Width of row
width: 100,
// Gauge width in the row
gaugeWidth: 40,
// Using colors
colors: true,
// Width of row
width: 100,
// Gauge width in the row
gaugeWidth: 40,
},
},
},
@@ -202,7 +219,6 @@ const brokerConfig: BrokerOptions = {
started: async (broker: ServiceBroker): Promise<void> => {},
stopped: async (broker: ServiceBroker): Promise<void> => {},
*/
};
export = brokerConfig;

300
package-lock.json generated
View File

@@ -32,12 +32,10 @@
"node-7z": "^3.0.0",
"node-calibre": "^2.1.1",
"node-unrar-js": "^1.0.2",
"pino": "^6.11.3",
"pino-pretty": "^4.7.1",
"sharp": "^0.28.1",
"socket.io": "^4.1.1",
"socket.io-stream": "^0.5.3",
"threetwo-ui-typings": "^1.0.3",
"threetwo-ui-typings": "^1.0.4",
"typescript": "^3.8.3",
"xml2js": "^0.4.23"
},
@@ -52,6 +50,8 @@
"jest": "^25.1.0",
"jest-cli": "^25.1.0",
"moleculer-repl": "^0.6.2",
"pino": "^6.13.2",
"pino-pretty": "^7.0.0",
"ts-jest": "^25.3.0",
"ts-node": "^8.8.1"
},
@@ -652,11 +652,6 @@
"@canvas/image-data": "^1.0.0"
}
},
"node_modules/@hapi/bourne": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-2.0.0.tgz",
"integrity": "sha512-WEezM1FWztfbzqIUbsDzFRVMxSoLy3HugVcux6KDDtTqzPsLE8NDRHfXvev66aH1i2oOKKar3/XDjbvh/OUBdg=="
},
"node_modules/@istanbuljs/load-nyc-config": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
@@ -3228,6 +3223,7 @@
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.5.1.tgz",
"integrity": "sha512-OD0TZ+B7yP7ZgpJf5K2DIbj3FZvFvxgFUuaqA/V5zTjAtAAXZ1E8bktHxmAGs4x5b7PflqA9LeQ84Og7wYtF7Q==",
"dev": true,
"engines": {
"node": "*"
}
@@ -4529,6 +4525,7 @@
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.0.2.tgz",
"integrity": "sha512-YN+CYfCVRVMUZOUPeinHNKgytM1wPI/C/UCLEi56EsY2dwwvI00kIJHJoI7pMVqGoMew8SMZ2SSfHKHULHXDsg==",
"devOptional": true,
"engines": {
"node": ">=6"
}
@@ -4536,7 +4533,8 @@
"node_modules/fast-safe-stringify": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz",
"integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag=="
"integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==",
"devOptional": true
},
"node_modules/fastest-validator": {
"version": "1.11.1",
@@ -4546,7 +4544,8 @@
"node_modules/fastify-warning": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/fastify-warning/-/fastify-warning-0.2.0.tgz",
"integrity": "sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw=="
"integrity": "sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw==",
"devOptional": true
},
"node_modules/fb-watchman": {
"version": "2.0.1",
@@ -4641,7 +4640,8 @@
"node_modules/flatstr": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/flatstr/-/flatstr-1.0.12.tgz",
"integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw=="
"integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw==",
"devOptional": true
},
"node_modules/flatted": {
"version": "2.0.2",
@@ -7624,20 +7624,13 @@
"node": ">=8"
}
},
"node_modules/jmespath": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz",
"integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=",
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/joycon": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/joycon/-/joycon-2.2.5.tgz",
"integrity": "sha512-YqvUxoOcVPnCp0VU1/56f+iKSdvIRJYPznH22BdXV3xMk75SFXhWeJkZ8C9XxUWt1b5x2X1SxuFygW1U0FmkEQ==",
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/joycon/-/joycon-3.0.1.tgz",
"integrity": "sha512-SJcJNBg32dGgxhPtM0wQqxqV0ax9k/9TaUskGDSJkSFSQOEWWvQ3zzWdGQRIUry2j1zA5+ReH13t0Mf3StuVZA==",
"dev": true,
"engines": {
"node": ">=6"
"node": ">=10"
}
},
"node_modules/jpeg-js": {
@@ -9820,9 +9813,10 @@
}
},
"node_modules/pino": {
"version": "6.13.1",
"resolved": "https://registry.npmjs.org/pino/-/pino-6.13.1.tgz",
"integrity": "sha512-QQf67BU+cANnc/2U+wzUV20UjO5oBryWpnNyKshdLfT9BdeiXlh9wxLGmOjAuBWMYITdMs+BtJSQQNlGRNbWpA==",
"version": "6.13.2",
"resolved": "https://registry.npmjs.org/pino/-/pino-6.13.2.tgz",
"integrity": "sha512-vmD/cabJ4xKqo9GVuAoAEeQhra8XJ7YydPV/JyIP+0zDtFTu5JSKdtt8eksGVWKtTSrNGcRrzJ4/IzvUWep3FA==",
"devOptional": true,
"dependencies": {
"fast-redact": "^3.0.0",
"fast-safe-stringify": "^2.0.8",
@@ -9836,101 +9830,49 @@
"pino": "bin.js"
}
},
"node_modules/pino-pretty": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-4.8.0.tgz",
"integrity": "sha512-mhQfHG4rw5ZFpWL44m0Utjo4GC2+HMfdNvxyA8lLw0sIqn6fCf7uQe6dPckUcW/obly+OQHD7B/MTso6LNizYw==",
"node_modules/pino-abstract-transport": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-0.2.0.tgz",
"integrity": "sha512-40sX7xrzDXsrUYr65brL0+bLm6rpZ+wCujDeeBmmZ/y5RVcPdVQsmz0bBe8NtTpELgmzmKwRRPVj1lvKjgFVHw==",
"dev": true,
"dependencies": {
"split2": "^3.2.2"
}
},
"node_modules/pino-pretty": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-7.0.0.tgz",
"integrity": "sha512-lU5RpkfssYJxRI/veMGsUu7RqTUD/NDb2r+U4VIx7Dyo5vA3MbbbGMUOhAM4e02IAYXuTAa/PH56s8shstP9BA==",
"dev": true,
"dependencies": {
"@hapi/bourne": "^2.0.0",
"args": "^5.0.1",
"chalk": "^4.0.0",
"colorette": "^1.3.0",
"dateformat": "^4.5.1",
"fast-safe-stringify": "^2.0.7",
"jmespath": "^0.15.0",
"joycon": "^2.2.5",
"joycon": "^3.0.0",
"pino-abstract-transport": "^0.2.0",
"pump": "^3.0.0",
"readable-stream": "^3.6.0",
"rfdc": "^1.3.0",
"split2": "^3.1.1",
"secure-json-parse": "^2.4.0",
"sonic-boom": "^2.2.0",
"strip-json-comments": "^3.1.1"
},
"bin": {
"pino-pretty": "bin.js"
}
},
"node_modules/pino-pretty/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/pino-pretty/node_modules/chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dependencies": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/pino-pretty/node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/pino-pretty/node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/pino-pretty/node_modules/has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/pino-pretty/node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/pino-std-serializers": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz",
"integrity": "sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg=="
"integrity": "sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg==",
"devOptional": true
},
"node_modules/pino/node_modules/sonic-boom": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-1.4.1.tgz",
"integrity": "sha512-LRHh/A8tpW7ru89lrlkU4AszXt1dbwSjVWguGrmlxE7tawVmDBlI1PILMkXAxJTwqhgsEeTHzj36D5CmHgQmNg==",
"devOptional": true,
"dependencies": {
"atomic-sleep": "^1.0.0",
"flatstr": "^1.0.12"
@@ -10160,7 +10102,8 @@
"node_modules/quick-format-unescaped": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.3.tgz",
"integrity": "sha512-MaL/oqh02mhEo5m5J2rwsVL23Iw2PEaGVHgT2vFt8AAsr0lfvQA5dpXo9TPu0rz7tSBdUPgkbam0j/fj5ZM8yg=="
"integrity": "sha512-MaL/oqh02mhEo5m5J2rwsVL23Iw2PEaGVHgT2vFt8AAsr0lfvQA5dpXo9TPu0rz7tSBdUPgkbam0j/fj5ZM8yg==",
"devOptional": true
},
"node_modules/range-parser": {
"version": "1.2.1",
@@ -10543,7 +10486,8 @@
"node_modules/rfdc": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz",
"integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA=="
"integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==",
"dev": true
},
"node_modules/rimraf": {
"version": "2.6.3",
@@ -10871,6 +10815,12 @@
"node": ">=8"
}
},
"node_modules/secure-json-parse": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.4.0.tgz",
"integrity": "sha512-Q5Z/97nbON5t/L/sH6mY2EacfjVGwrCcSi5D3btRO2GZ8pf1K1UN7Z9H5J57hjVU2Qzxr1xO+FmBhOvEkzCMmg==",
"dev": true
},
"node_modules/semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
@@ -11510,6 +11460,7 @@
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",
"integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==",
"dev": true,
"dependencies": {
"readable-stream": "^3.0.0"
}
@@ -11831,6 +11782,7 @@
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true,
"engines": {
"node": ">=8"
},
@@ -11996,9 +11948,9 @@
"dev": true
},
"node_modules/threetwo-ui-typings": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/threetwo-ui-typings/-/threetwo-ui-typings-1.0.3.tgz",
"integrity": "sha512-whyTLLMsgDIR6jkrJrz58qiMG8mYXF5V8akBI0okCmsE2djsnVPaihvXcL8bZWH4/HktqC86iJs9F9oYaG/4Ig==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/threetwo-ui-typings/-/threetwo-ui-typings-1.0.4.tgz",
"integrity": "sha512-Hpke7x19mctO4q8/jSdtT4I08J3zpl5IjXsIC5N6ti7xXf6QAF04tHxhtWsAHgREQzxf05rMXNtjtMlHIKYr8w==",
"dependencies": {
"typescript": "^4.3.2"
}
@@ -13478,11 +13430,6 @@
"@canvas/image-data": "^1.0.0"
}
},
"@hapi/bourne": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-2.0.0.tgz",
"integrity": "sha512-WEezM1FWztfbzqIUbsDzFRVMxSoLy3HugVcux6KDDtTqzPsLE8NDRHfXvev66aH1i2oOKKar3/XDjbvh/OUBdg=="
},
"@istanbuljs/load-nyc-config": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
@@ -15546,7 +15493,8 @@
"dateformat": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.5.1.tgz",
"integrity": "sha512-OD0TZ+B7yP7ZgpJf5K2DIbj3FZvFvxgFUuaqA/V5zTjAtAAXZ1E8bktHxmAGs4x5b7PflqA9LeQ84Og7wYtF7Q=="
"integrity": "sha512-OD0TZ+B7yP7ZgpJf5K2DIbj3FZvFvxgFUuaqA/V5zTjAtAAXZ1E8bktHxmAGs4x5b7PflqA9LeQ84Og7wYtF7Q==",
"dev": true
},
"debug": {
"version": "4.3.2",
@@ -16601,12 +16549,14 @@
"fast-redact": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.0.2.tgz",
"integrity": "sha512-YN+CYfCVRVMUZOUPeinHNKgytM1wPI/C/UCLEi56EsY2dwwvI00kIJHJoI7pMVqGoMew8SMZ2SSfHKHULHXDsg=="
"integrity": "sha512-YN+CYfCVRVMUZOUPeinHNKgytM1wPI/C/UCLEi56EsY2dwwvI00kIJHJoI7pMVqGoMew8SMZ2SSfHKHULHXDsg==",
"devOptional": true
},
"fast-safe-stringify": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz",
"integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag=="
"integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==",
"devOptional": true
},
"fastest-validator": {
"version": "1.11.1",
@@ -16616,7 +16566,8 @@
"fastify-warning": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/fastify-warning/-/fastify-warning-0.2.0.tgz",
"integrity": "sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw=="
"integrity": "sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw==",
"devOptional": true
},
"fb-watchman": {
"version": "2.0.1",
@@ -16687,7 +16638,8 @@
"flatstr": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/flatstr/-/flatstr-1.0.12.tgz",
"integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw=="
"integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw==",
"devOptional": true
},
"flatted": {
"version": "2.0.2",
@@ -18931,15 +18883,11 @@
}
}
},
"jmespath": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz",
"integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc="
},
"joycon": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/joycon/-/joycon-2.2.5.tgz",
"integrity": "sha512-YqvUxoOcVPnCp0VU1/56f+iKSdvIRJYPznH22BdXV3xMk75SFXhWeJkZ8C9XxUWt1b5x2X1SxuFygW1U0FmkEQ=="
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/joycon/-/joycon-3.0.1.tgz",
"integrity": "sha512-SJcJNBg32dGgxhPtM0wQqxqV0ax9k/9TaUskGDSJkSFSQOEWWvQ3zzWdGQRIUry2j1zA5+ReH13t0Mf3StuVZA==",
"dev": true
},
"jpeg-js": {
"version": "0.4.3",
@@ -20549,9 +20497,10 @@
"dev": true
},
"pino": {
"version": "6.13.1",
"resolved": "https://registry.npmjs.org/pino/-/pino-6.13.1.tgz",
"integrity": "sha512-QQf67BU+cANnc/2U+wzUV20UjO5oBryWpnNyKshdLfT9BdeiXlh9wxLGmOjAuBWMYITdMs+BtJSQQNlGRNbWpA==",
"version": "6.13.2",
"resolved": "https://registry.npmjs.org/pino/-/pino-6.13.2.tgz",
"integrity": "sha512-vmD/cabJ4xKqo9GVuAoAEeQhra8XJ7YydPV/JyIP+0zDtFTu5JSKdtt8eksGVWKtTSrNGcRrzJ4/IzvUWep3FA==",
"devOptional": true,
"requires": {
"fast-redact": "^3.0.0",
"fast-safe-stringify": "^2.0.8",
@@ -20566,6 +20515,7 @@
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-1.4.1.tgz",
"integrity": "sha512-LRHh/A8tpW7ru89lrlkU4AszXt1dbwSjVWguGrmlxE7tawVmDBlI1PILMkXAxJTwqhgsEeTHzj36D5CmHgQmNg==",
"devOptional": true,
"requires": {
"atomic-sleep": "^1.0.0",
"flatstr": "^1.0.12"
@@ -20573,74 +20523,40 @@
}
}
},
"pino-pretty": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-4.8.0.tgz",
"integrity": "sha512-mhQfHG4rw5ZFpWL44m0Utjo4GC2+HMfdNvxyA8lLw0sIqn6fCf7uQe6dPckUcW/obly+OQHD7B/MTso6LNizYw==",
"pino-abstract-transport": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-0.2.0.tgz",
"integrity": "sha512-40sX7xrzDXsrUYr65brL0+bLm6rpZ+wCujDeeBmmZ/y5RVcPdVQsmz0bBe8NtTpELgmzmKwRRPVj1lvKjgFVHw==",
"dev": true,
"requires": {
"split2": "^3.2.2"
}
},
"pino-pretty": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-7.0.0.tgz",
"integrity": "sha512-lU5RpkfssYJxRI/veMGsUu7RqTUD/NDb2r+U4VIx7Dyo5vA3MbbbGMUOhAM4e02IAYXuTAa/PH56s8shstP9BA==",
"dev": true,
"requires": {
"@hapi/bourne": "^2.0.0",
"args": "^5.0.1",
"chalk": "^4.0.0",
"colorette": "^1.3.0",
"dateformat": "^4.5.1",
"fast-safe-stringify": "^2.0.7",
"jmespath": "^0.15.0",
"joycon": "^2.2.5",
"joycon": "^3.0.0",
"pino-abstract-transport": "^0.2.0",
"pump": "^3.0.0",
"readable-stream": "^3.6.0",
"rfdc": "^1.3.0",
"split2": "^3.1.1",
"secure-json-parse": "^2.4.0",
"sonic-boom": "^2.2.0",
"strip-json-comments": "^3.1.1"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"pino-std-serializers": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz",
"integrity": "sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg=="
"integrity": "sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg==",
"devOptional": true
},
"pirates": {
"version": "4.0.1",
@@ -20813,7 +20729,8 @@
"quick-format-unescaped": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.3.tgz",
"integrity": "sha512-MaL/oqh02mhEo5m5J2rwsVL23Iw2PEaGVHgT2vFt8AAsr0lfvQA5dpXo9TPu0rz7tSBdUPgkbam0j/fj5ZM8yg=="
"integrity": "sha512-MaL/oqh02mhEo5m5J2rwsVL23Iw2PEaGVHgT2vFt8AAsr0lfvQA5dpXo9TPu0rz7tSBdUPgkbam0j/fj5ZM8yg==",
"devOptional": true
},
"range-parser": {
"version": "1.2.1",
@@ -21108,7 +21025,8 @@
"rfdc": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz",
"integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA=="
"integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==",
"dev": true
},
"rimraf": {
"version": "2.6.3",
@@ -21374,6 +21292,12 @@
"xmlchars": "^2.1.1"
}
},
"secure-json-parse": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.4.0.tgz",
"integrity": "sha512-Q5Z/97nbON5t/L/sH6mY2EacfjVGwrCcSi5D3btRO2GZ8pf1K1UN7Z9H5J57hjVU2Qzxr1xO+FmBhOvEkzCMmg==",
"dev": true
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
@@ -21913,6 +21837,7 @@
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",
"integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==",
"dev": true,
"requires": {
"readable-stream": "^3.0.0"
}
@@ -22156,7 +22081,8 @@
"strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true
},
"supports-color": {
"version": "5.5.0",
@@ -22287,9 +22213,9 @@
"dev": true
},
"threetwo-ui-typings": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/threetwo-ui-typings/-/threetwo-ui-typings-1.0.3.tgz",
"integrity": "sha512-whyTLLMsgDIR6jkrJrz58qiMG8mYXF5V8akBI0okCmsE2djsnVPaihvXcL8bZWH4/HktqC86iJs9F9oYaG/4Ig==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/threetwo-ui-typings/-/threetwo-ui-typings-1.0.4.tgz",
"integrity": "sha512-Hpke7x19mctO4q8/jSdtT4I08J3zpl5IjXsIC5N6ti7xXf6QAF04tHxhtWsAHgREQzxf05rMXNtjtMlHIKYr8w==",
"requires": {
"typescript": "^4.3.2"
},

View File

@@ -30,6 +30,8 @@
"jest": "^25.1.0",
"jest-cli": "^25.1.0",
"moleculer-repl": "^0.6.2",
"pino": "^6.13.2",
"pino-pretty": "^7.0.0",
"ts-jest": "^25.3.0",
"ts-node": "^8.8.1"
},
@@ -58,12 +60,10 @@
"node-7z": "^3.0.0",
"node-calibre": "^2.1.1",
"node-unrar-js": "^1.0.2",
"pino": "^6.11.3",
"pino-pretty": "^4.7.1",
"sharp": "^0.28.1",
"socket.io": "^4.1.1",
"socket.io-stream": "^0.5.3",
"threetwo-ui-typings": "^1.0.3",
"threetwo-ui-typings": "^1.0.4",
"typescript": "^3.8.3",
"xml2js": "^0.4.23"
},

View File

@@ -22,9 +22,9 @@ export const sendRabbitMQ = (queueName, data) => {
channel.sendToQueue(queue, Buffer.from(data));
logger.info(`${data} sent`);
});
setTimeout(function () {
setTimeout(function() {
connection.close();
//process.exit(0);
// process.exit(0);
}, 500);
});
};

View File

@@ -58,6 +58,10 @@ export default class ApiService extends Service {
path: "/comics",
use: [ApiGateway.serveStatic("comics")],
},
{
path: "/logs",
use: [ApiGateway.serveStatic("logs")],
},
],
log4XXResponses: false,
logRequestParams: null,

View File

@@ -2,7 +2,7 @@
import { ServiceBroker } from "moleculer";
import DbService from "moleculer-db";
import DbMixin from "../../../mixins/db.mixin";
import {DbMixin} from "../../../mixins/db.mixin";
describe("Test DB mixin", () => {

View File

@@ -1,20 +1,19 @@
import { default as Pino } from "pino";
import { default as pinopretty } from "pino-pretty";
const Pino = require("pino");
export const logger = Pino({
name: "Threetwo!",
prettyPrint: { colorize: true },
// crlf: false,
// errorLikeObjectKeys: ["err", "error"],
crlf: false,
errorLikeObjectKeys: ["err", "error"],
// errorProps: "",
// levelFirst: false,
levelFirst: false,
messageKey: "msg", // --messageKey
levelKey: "level", // --levelKey
// messageFormat: false, // --messageFormat
// timestampKey: "time", // --timestampKey
// translateTime: false, // --translateTime
translateTime: false, // --translateTime
// search: "foo == `bar`", // --search
// ignore: "pid,hostname", // --ignore
// hideObject: false, // --hideObject
hideObject: false, // --hideObject
// singleLine: false,
});