@sealsystems/log
Advanced tools
Comparing version 2.4.1 to 2.4.3
@@ -7,3 +7,3 @@ 'use strict'; | ||
const getMiddleware = function(flaschenpost) { | ||
const getMiddleware = function (flaschenpost) { | ||
class Middleware extends Writable { | ||
@@ -10,0 +10,0 @@ constructor(level, source) { |
@@ -5,3 +5,3 @@ 'use strict'; | ||
const logAndTerminate = function(err, promise) { | ||
const logAndTerminate = function (err, promise) { | ||
if (promise) { | ||
@@ -8,0 +8,0 @@ flaschenpost.getLogger().fatal('Unhandled rejection occurred. Terminate process.', { err, promise }); |
@@ -22,6 +22,12 @@ 'use strict'; | ||
logEntry.isoTimestamp = new Date(logEntry.timestamp).toISOString(); | ||
// Temporary: If incoming metadata is not of type object, transform it. | ||
// This is neccessary to fit the type definitions in ELK | ||
if (logEntry.metadata && logEntry.metadata.err && typeof logEntry.metadata.err !== 'object') { | ||
logEntry.metadata.err = { message: logEntry.metadata.err.toString() }; | ||
if (logEntry.metadata) { | ||
// try to avoid type mismatches in elasticsearch (pls-1626) | ||
if (typeof logEntry.metadata !== 'object') { | ||
logEntry.metadata = { value: logEntry.metadata.toString() }; | ||
} | ||
// Temporary: If incoming metadata is not of type object, transform it. | ||
// This is neccessary to fit the type definitions in ELK | ||
else if (logEntry.metadata.err && typeof logEntry.metadata.err !== 'object') { | ||
logEntry.metadata.err = { message: logEntry.metadata.err.toString() }; | ||
} | ||
} | ||
@@ -28,0 +34,0 @@ return defaultConfig.formatter(logEntry); |
'use strict'; | ||
/* eslint-disable no-process-env */ | ||
const parseLogLevelEnv = function() { | ||
const parseLogLevelEnv = function () { | ||
if (!process.env.LOG_LEVEL) { | ||
@@ -6,0 +6,0 @@ return; |
{ | ||
"name": "@sealsystems/log", | ||
"version": "2.4.1", | ||
"version": "2.4.3", | ||
"description": "Logger for all Node.js modules by SEAL Systems", | ||
@@ -28,12 +28,11 @@ "author": { | ||
"dependencies": { | ||
"flaschenpost": "5.0.47", | ||
"flaschenpost": "5.0.49", | ||
"stack-trace": "0.0.10" | ||
}, | ||
"devDependencies": { | ||
"@sealsystems/eslint-config-es": "3.6.7", | ||
"@sealsystems/mocha": "4.1.10", | ||
"@sealsystems/semantic-release": "4.3.4", | ||
"nodeenv": "3.0.69", | ||
"@sealsystems/eslint-config-es": "3.7.8", | ||
"@sealsystems/mocha": "4.2.3", | ||
"nodeenv": "3.0.71", | ||
"proxyquire": "2.1.3", | ||
"sinon": "11.1.2" | ||
"sinon": "12.0.1" | ||
}, | ||
@@ -44,5 +43,4 @@ "release": { | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org" | ||
"access": "public" | ||
} | ||
} |
@@ -99,9 +99,1 @@ # @sealsystems/log | ||
The environment variable `LOG_LEVEL` has precedence over `LOG_LEVELS`. | ||
## Running the build | ||
To build this module use [roboter](https://www.npmjs.com/package/roboter). | ||
```bash | ||
$ bot | ||
``` |
Sorry, the diff of this file is not supported yet
5
91
7689
7
99
+ Added@types/node@16.6.1(transitive)
+ Addedflaschenpost@5.0.49(transitive)
+ Addedprocessenv@3.0.9(transitive)
- Removed@types/node@16.4.13(transitive)
- Removedflaschenpost@5.0.47(transitive)
- Removedprocessenv@3.0.8(transitive)
Updatedflaschenpost@5.0.49