@logdna/logger
Advanced tools
Comparing version 2.6.6 to 2.6.7
## Changelog | ||
## [2.6.7](https://github.com/logdna/logger-node/compare/v2.6.6...v2.6.7) (2023-04-21) | ||
### Bug Fixes | ||
* **doc**: Best practices code snipit does not work as an example [4864553](https://github.com/logdna/logger-node/commit/4864553d04cab50b7cdeaad4020c3cb09cb35880) - Darin Spivey, closes: [#74](https://github.com/logdna/logger-node/issues/74) | ||
### Chores | ||
* **ci**: Test with node 18 [efd6a44](https://github.com/logdna/logger-node/commit/efd6a44234dd671c7dc8e5d97611a4abdba81ec4) - Darin Spivey | ||
## [2.6.6](https://github.com/logdna/logger-node/compare/v2.6.5...v2.6.6) (2022-06-29) | ||
@@ -4,0 +16,0 @@ |
{ | ||
"name": "@logdna/logger", | ||
"version": "2.6.6", | ||
"version": "2.6.7", | ||
"description": "LogDNA's Node.js Logging Module.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -508,4 +508,5 @@ <p align="center"> | ||
const {once} = require('events') | ||
const process = require('process') | ||
const logger = createLogger('<YOUR KEY HERE>') | ||
const logger = createLogger('This is not a real key and will cause an error') | ||
@@ -515,4 +516,4 @@ logger.on('error', console.error) | ||
function onSignal(signal) { | ||
logger.warn({signal}, 'received signal, shutting down') | ||
shutdown() | ||
logger.warn(`received signal ${signal} shutting down`, {meta: {signal}}) | ||
shutdown().catch(() => {}) | ||
} | ||
@@ -526,2 +527,9 @@ | ||
process.on('SIGINT', onSignal) | ||
// For running this as a standalone example, an error will be shown due | ||
// to the key being invalid, but it shows the signal handler message | ||
// attempting to be sent for ingestion. | ||
setTimeout(() => { | ||
process.kill(process.pid) | ||
}, 1000) | ||
``` | ||
@@ -528,0 +536,0 @@ |
86438
671