impress
Advanced tools
Comparing version 2.6.7 to 2.6.8
@@ -5,2 +5,6 @@ # Changelog | ||
## [2.6.8][] - 2022-03-19 | ||
- Add error handler for logger in master and worker threads | ||
## [2.6.7][] - 2022-03-18 | ||
@@ -253,3 +257,4 @@ | ||
[unreleased]: https://github.com/metarhia/impress/compare/v2.6.7...HEAD | ||
[unreleased]: https://github.com/metarhia/impress/compare/v2.6.8...HEAD | ||
[2.6.8]: https://github.com/metarhia/impress/compare/v2.6.7...v2.6.8 | ||
[2.6.7]: https://github.com/metarhia/impress/compare/v2.6.6...v2.6.7 | ||
@@ -256,0 +261,0 @@ [2.6.6]: https://github.com/metarhia/impress/compare/v2.6.5...v2.6.6 |
@@ -21,4 +21,9 @@ 'use strict'; | ||
const logOpt = { path: LOG_PATH, workerId: 0, toFile: [] }; | ||
const { console } = await new Logger(logOpt); | ||
const logger = await new Logger(logOpt); | ||
const console = logger.active ? logger.console : global.console; | ||
logger.on('error', (err) => { | ||
console.error(err.stack); | ||
}); | ||
const exit = (message = 'Can not start server') => { | ||
@@ -25,0 +30,0 @@ console.error(metautil.replace(message, PATH, '')); |
@@ -26,6 +26,5 @@ 'use strict'; | ||
}); | ||
const { console } = logger; | ||
Object.assign(application, { config, logger, console }); | ||
const logError = (type) => async (err) => { | ||
const console = logger.active ? logger.console : global.console; | ||
console.error( | ||
@@ -43,2 +42,6 @@ `${type} error detected: ${err && err.message}`, | ||
logger.on('error', logError('metalog failed')); | ||
const { console } = logger; | ||
Object.assign(application, { config, logger, console }); | ||
if (notLoaded.size > 0) { | ||
@@ -45,0 +48,0 @@ if (threadId === 1) { |
{ | ||
"name": "impress", | ||
"version": "2.6.7", | ||
"version": "2.6.8", | ||
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Enterprise application server for Node.js", |
<div align="center"> | ||
[![impress logo](https://raw.githubusercontent.com/metarhia/Metarhia/master/Logos/impress-header.png)](https://github.com/metarhia/impress) | ||
[![ci Status](https://github.com/metarhia/impress/workflows/Testing%20CI/badge.svg)](https://github.com/metarhia/impress/actions?query=workflow%3A%22Testing+CI%22+branch%3Amaster) | ||
@@ -6,0 +5,0 @@ [![snyk](https://snyk.io/test/github/metarhia/impress/badge.svg)](https://snyk.io/test/github/metarhia/impress) |
63905
1425
111