@zodash/logger
Advanced tools
Comparing version 0.2.18 to 0.2.19
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.2.19](https://github.com/zcorky/zodash/compare/@zodash/logger@0.2.18...@zodash/logger@0.2.19) (2021-08-16) | ||
### Bug Fixes | ||
* **logger:** setLogDir array message join with white space instead of default common ([95b5526](https://github.com/zcorky/zodash/commit/95b5526b50329dcac76e1eed9329d8bef37f4944)) | ||
## [0.2.18](https://github.com/zcorky/zodash/compare/@zodash/logger@0.2.17...@zodash/logger@0.2.18) (2021-08-12) | ||
@@ -8,0 +19,0 @@ |
@@ -194,4 +194,15 @@ "use strict"; | ||
const logfileAll = await this.getLogFile('all'); | ||
// @TODO | ||
const message = `[${ctx.input.datetime.format('YYYY-MM-DD HH:mm:ss.SSS')}] ${ctx.input.level.toUpperCase()} - ${ctx.input.message}`; | ||
let message = this.getLogMessage(ctx.input.datetime, ctx.input.message, ctx.input.level); | ||
if (Array.isArray(message)) { | ||
const [prefix, ...rest] = message; | ||
const restText = rest | ||
.map((item) => { | ||
if (typeof item === 'object') { | ||
return JSON.stringify(item, null, 2); | ||
} | ||
return item; | ||
}) | ||
.join(' '); | ||
message = `${prefix} - ${restText}`; | ||
} | ||
logfile.write(message + '\n'); | ||
@@ -198,0 +209,0 @@ logfileAll.write(message + '\n'); |
{ | ||
"name": "@zodash/logger", | ||
"version": "0.2.18", | ||
"version": "0.2.19", | ||
"description": "simple logger model", | ||
@@ -71,3 +71,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "e82196181887d3c07c5ceeacd3cea4d5b381c744" | ||
"gitHead": "a2775382fcee1dffdbad784479eb960d497f1502" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21871
318