flaschenpost
Advanced tools
Comparing version 5.0.49 to 5.0.50
@@ -12,3 +12,3 @@ "use strict"; | ||
constructor(debugModuleFilter, formatter, highestEnabledLogLevel, hostname, logEntryIdGenerator) { | ||
this.application = readPackageJson_1.readPackageJson(app_root_path_1.default.path); | ||
this.application = (0, readPackageJson_1.readPackageJson)(app_root_path_1.default.path); | ||
this.debugModuleFilter = debugModuleFilter; | ||
@@ -21,3 +21,3 @@ this.formatter = formatter; | ||
withApplication(application) { | ||
const newConfiguration = lodash_1.cloneDeep(this); | ||
const newConfiguration = (0, lodash_1.cloneDeep)(this); | ||
newConfiguration.application = application; | ||
@@ -27,3 +27,3 @@ return newConfiguration; | ||
withDebugModuleFilter(debugModuleFilter) { | ||
const newConfiguration = lodash_1.cloneDeep(this); | ||
const newConfiguration = (0, lodash_1.cloneDeep)(this); | ||
newConfiguration.debugModuleFilter = debugModuleFilter; | ||
@@ -33,3 +33,3 @@ return newConfiguration; | ||
withFormatter(formatter) { | ||
const newConfiguration = lodash_1.cloneDeep(this); | ||
const newConfiguration = (0, lodash_1.cloneDeep)(this); | ||
newConfiguration.formatter = formatter; | ||
@@ -39,3 +39,3 @@ return newConfiguration; | ||
withHighestEnabledLogLevel(highestEnabledLogLevel) { | ||
const newConfiguration = lodash_1.cloneDeep(this); | ||
const newConfiguration = (0, lodash_1.cloneDeep)(this); | ||
newConfiguration.highestEnabledLogLevel = highestEnabledLogLevel; | ||
@@ -45,3 +45,3 @@ return newConfiguration; | ||
withHostname(hostname) { | ||
const newConfiguration = lodash_1.cloneDeep(this); | ||
const newConfiguration = (0, lodash_1.cloneDeep)(this); | ||
newConfiguration.hostname = hostname; | ||
@@ -51,3 +51,3 @@ return newConfiguration; | ||
withLogEntryIdGenerator(logEntryIdGenerator) { | ||
const newConfiguration = lodash_1.cloneDeep(this); | ||
const newConfiguration = (0, lodash_1.cloneDeep)(this); | ||
newConfiguration.logEntryIdGenerator = logEntryIdGenerator; | ||
@@ -54,0 +54,0 @@ return newConfiguration; |
@@ -21,3 +21,3 @@ "use strict"; | ||
constructor() { | ||
const stringifiedDebugModuleFilter = processenv_1.processenv('LOG_DEBUG_MODULE_FILTER', ''); | ||
const stringifiedDebugModuleFilter = (0, processenv_1.processenv)('LOG_DEBUG_MODULE_FILTER', ''); | ||
if (typeof stringifiedDebugModuleFilter !== 'string') { | ||
@@ -30,8 +30,8 @@ throw new Error('Debug module filter invalid.'); | ||
let formatter = process.stdout.isTTY ? formatters_1.asHumanReadable : formatters_1.asJson; | ||
const formatterOverride = processenv_1.processenv('LOG_FORMATTER'); | ||
const formatterOverride = (0, processenv_1.processenv)('LOG_FORMATTER'); | ||
if (formatterOverride) { | ||
formatter = formatterOverride === 'human' ? formatters_1.asHumanReadable : formatters_1.asJson; | ||
} | ||
const logLevel = processenv_1.processenv('LOG_LEVEL', 'info'); | ||
if (!isLogLevel_1.isLogLevel(logLevel)) { | ||
const logLevel = (0, processenv_1.processenv)('LOG_LEVEL', 'info'); | ||
if (!(0, isLogLevel_1.isLogLevel)(logLevel)) { | ||
throw new Error(`Log level '${logLevel}' unknown.`); | ||
@@ -41,3 +41,3 @@ } | ||
const hostname = os_1.default.hostname(); | ||
const logEntryIdGenerator = getLogEntryIdGenerator_1.getLogEntryIdGenerator(); | ||
const logEntryIdGenerator = (0, getLogEntryIdGenerator_1.getLogEntryIdGenerator)(); | ||
this.configuration = new Configuration_1.Configuration(debugModuleFilter, formatter, highestEnabledLogLevel, hostname, logEntryIdGenerator); | ||
@@ -49,3 +49,3 @@ } | ||
getConfiguration() { | ||
return lodash_1.cloneDeep(this.configuration); | ||
return (0, lodash_1.cloneDeep)(this.configuration); | ||
} | ||
@@ -79,4 +79,4 @@ // When creating a logger, there are basically two options: Most probably you | ||
else { | ||
const modulePath = find_root_1.default(sourcePath); | ||
packageJson = readPackageJson_1.readPackageJson(modulePath); | ||
const modulePath = (0, find_root_1.default)(sourcePath); | ||
packageJson = (0, readPackageJson_1.readPackageJson)(modulePath); | ||
} | ||
@@ -83,0 +83,0 @@ return new Logger_1.Logger(this.configuration, sourcePath, packageJson); |
@@ -32,9 +32,9 @@ "use strict"; | ||
result += '\n'; | ||
result += chalk_1.default.gray(`${date_fns_1.lightFormat(dateTime, 'HH:mm:ss.SSS')}@${date_fns_1.lightFormat(dateTime, 'yyyy-MM-dd')} ${logEntry.processId}#${logEntry.id}`); | ||
result += chalk_1.default.gray(`${(0, date_fns_1.lightFormat)(dateTime, 'HH:mm:ss.SSS')}@${(0, date_fns_1.lightFormat)(dateTime, 'yyyy-MM-dd')} ${logEntry.processId}#${logEntry.id}`); | ||
result += '\n'; | ||
if (logEntry.metadata) { | ||
result += chalk_1.default.gray(stringify_object_1.default(logEntry.metadata, { | ||
result += chalk_1.default.gray((0, stringify_object_1.default)(logEntry.metadata, { | ||
indent: ' ', | ||
singleQuotes: true | ||
}).replace(/\\n/gu, '\n')); | ||
}).replaceAll(/\\n/gu, '\n')); | ||
result += '\n'; | ||
@@ -41,0 +41,0 @@ } |
@@ -17,3 +17,3 @@ "use strict"; | ||
if (metadata) { | ||
this.metadata = sanitizeMetadata_1.sanitizeMetadata(metadata); | ||
this.metadata = (0, sanitizeMetadata_1.sanitizeMetadata)(metadata); | ||
} | ||
@@ -20,0 +20,0 @@ } |
@@ -23,15 +23,11 @@ "use strict"; | ||
if (this.numericLogLevel < 5) { | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
this.debug = noop; | ||
} | ||
if (this.numericLogLevel < 4) { | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
this.info = noop; | ||
} | ||
if (this.numericLogLevel < 3) { | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
this.warn = noop; | ||
} | ||
if (this.numericLogLevel < 2) { | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
this.error = noop; | ||
@@ -38,0 +34,0 @@ } |
@@ -29,3 +29,3 @@ "use strict"; | ||
const requestStart = Date.now(); | ||
on_finished_1.default(res, () => { | ||
(0, on_finished_1.default)(res, () => { | ||
const responseEnd = Date.now(); | ||
@@ -32,0 +32,0 @@ const contentLengthHeader = res.getHeader('content-length'); |
@@ -7,10 +7,10 @@ "use strict"; | ||
const cloner = function (value) { | ||
if (!lodash_1.isError(value)) { | ||
if (!(0, lodash_1.isError)(value)) { | ||
return; | ||
} | ||
return serialize_error_1.serializeError(value); | ||
return (0, serialize_error_1.serializeError)(value); | ||
}; | ||
const sanitizeMetadata = function (metadata) { | ||
return lodash_1.cloneDeepWith(metadata, cloner); | ||
return (0, lodash_1.cloneDeepWith)(metadata, cloner); | ||
}; | ||
exports.sanitizeMetadata = sanitizeMetadata; |
@@ -0,1 +1,8 @@ | ||
## [5.0.50](https://github.com/thenativeweb/flaschenpost/compare/5.0.49...5.0.50) (2022-01-25) | ||
### Bug Fixes | ||
* bump @types/node from 17.0.9 to 17.0.10 ([#808](https://github.com/thenativeweb/flaschenpost/issues/808)) ([eaeabfd](https://github.com/thenativeweb/flaschenpost/commit/eaeabfdf06b23e8c20ee52b371972493f0563a11)) | ||
## [5.0.49](https://github.com/thenativeweb/flaschenpost/compare/5.0.48...5.0.49) (2021-08-17) | ||
@@ -2,0 +9,0 @@ |
@@ -43,3 +43,3 @@ import chalk from 'chalk'; | ||
singleQuotes: true | ||
}).replace(/\\n/gu, '\n')); | ||
}).replaceAll(/\\n/gu, '\n')); | ||
result += '\n'; | ||
@@ -46,0 +46,0 @@ } |
@@ -40,15 +40,11 @@ import { Configuration } from './Configuration'; | ||
if (this.numericLogLevel < 5) { | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
this.debug = noop; | ||
} | ||
if (this.numericLogLevel < 4) { | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
this.info = noop; | ||
} | ||
if (this.numericLogLevel < 3) { | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
this.warn = noop; | ||
} | ||
if (this.numericLogLevel < 2) { | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
this.error = noop; | ||
@@ -55,0 +51,0 @@ } |
{ | ||
"name": "flaschenpost", | ||
"version": "5.0.49", | ||
"version": "5.0.50", | ||
"description": "flaschenpost is a logger for cloud-based applications.", | ||
@@ -39,2 +39,3 @@ "contributors": [ | ||
], | ||
"private": false, | ||
"main": "build/lib/index.js", | ||
@@ -46,10 +47,10 @@ "types": "build/lib/index.d.ts", | ||
"@types/find-root": "1.1.2", | ||
"@types/lodash": "4.14.172", | ||
"@types/node": "16.6.1", | ||
"@types/lodash": "4.14.178", | ||
"@types/node": "17.0.10", | ||
"@types/on-finished": "2.3.1", | ||
"@types/stack-trace": "0.0.29", | ||
"@types/stringify-object": "3.3.1", | ||
"@types/stringify-object": "4.0.1", | ||
"app-root-path": "3.0.0", | ||
"chalk": "4.1.2", | ||
"date-fns": "2.23.0", | ||
"date-fns": "2.28.0", | ||
"find-root": "1.1.0", | ||
@@ -66,12 +67,13 @@ "lodash": "4.17.21", | ||
"@types/supertest": "2.0.11", | ||
"assertthat": "6.3.13", | ||
"common-tags": "1.8.0", | ||
"express": "4.17.1", | ||
"nodeenv": "3.0.71", | ||
"record-stdstreams": "3.0.69", | ||
"roboter": "11.7.8", | ||
"assertthat": "6.3.14", | ||
"common-tags": "1.8.2", | ||
"express": "4.17.2", | ||
"nodeenv": "3.0.72", | ||
"record-stdstreams": "3.0.71", | ||
"roboter": "12.6.2", | ||
"semantic-release-configuration": "2.0.5", | ||
"strip-ansi": "6.0.0", | ||
"supertest": "6.1.5" | ||
"supertest": "6.2.2" | ||
}, | ||
"scripts": {}, | ||
"repository": { | ||
@@ -78,0 +80,0 @@ "type": "git", |
@@ -15,3 +15,6 @@ { | ||
"./**/*.ts" | ||
], | ||
"exclude": [ | ||
"./build" | ||
] | ||
} |
96679
69
1071
+ Added@types/lodash@4.14.178(transitive)
+ Added@types/node@17.0.10(transitive)
+ Added@types/stringify-object@4.0.1(transitive)
+ Addeddate-fns@2.28.0(transitive)
- Removed@types/lodash@4.14.172(transitive)
- Removed@types/node@16.6.1(transitive)
- Removed@types/stringify-object@3.3.1(transitive)
- Removeddate-fns@2.23.0(transitive)
Updated@types/lodash@4.14.178
Updated@types/node@17.0.10
Updateddate-fns@2.28.0