@goodware/log
Advanced tools
Comparing version 3.2.6 to 3.3.0
# @goodware/log Release History | ||
## 3.2.7 2020-06-17 | ||
1. For plain console output, output level after the message | ||
2. [#39 Child logger caching](https://github.com/good-ware/js-log/issues/39) | ||
## 3.2.6 2020-06-15 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "@goodware/log", | ||
"version": "3.2.6", | ||
"version": "3.3.0", | ||
"description": "Batteries-included Winston3-based loggger with console, file, and AWS CloudWatch Logs transports", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -54,2 +54,7 @@ const deepmerge = require('deepmerge'); | ||
}, | ||
dog: { | ||
file: 'warn', | ||
console: 'warn', | ||
cloudWatch: 'warn', | ||
}, | ||
}, | ||
@@ -56,0 +61,0 @@ }, |
@@ -71,2 +71,29 @@ /* eslint-disable no-restricted-syntax */ | ||
// ============ logger() tests begin | ||
// 'dog' doesn't log at silly | ||
if (loggers.isLevelEnabled({ tags: 'silly', category: 'dog' })) throw new Error(); | ||
{ | ||
const count = unitTest.entries.length; | ||
loggers.logger('dog'); | ||
loggers.logger('dog').silly('a'); | ||
if (count !== unitTest.entries.length) throw new Error(); | ||
} | ||
// Now 'dog' logs at silly | ||
loggers.logger('dog', loggers.child(['warn', 'goofy'], null, null, 'cat')); | ||
if (!loggers.isLevelEnabled({ tags: 'silly', category: 'dog' })) throw new Error(); | ||
// Check the category of a saved logger is the same as the category provided to Loggers.logger() | ||
if (loggers.logger('dog').category() !== 'dog') throw new Error(); | ||
{ | ||
const count = unitTest.entries.length; | ||
loggers.logger('dog').silly('a'); // logLevel is specified via silly() | ||
if (count !== unitTest.entries.length) throw new Error(); | ||
loggers.logger('dog').log('a'); // Use the tags for dog's logger | ||
if (count === unitTest.entries.length) throw new Error(); | ||
} | ||
// ============ logger() tests end | ||
// Specify the level | ||
@@ -182,3 +209,3 @@ { | ||
const entry = unitTest.entries[unitTest.entries.length - 1]; | ||
if (!entry.category === 'dragon') throw new Error(); | ||
if (entry.category !== 'dragon') throw new Error(); | ||
if (!entry.tags.includes('extra')) throw new Error(); | ||
@@ -762,6 +789,6 @@ } | ||
// These values must be tweaked whenever more entries are logged | ||
if (unitTest.entries.length !== 167 + 10 * hasCloudWatch) throw new Error(unitTest.entries.length); | ||
if (unitTest.entries.length !== 169 + 10 * hasCloudWatch) throw new Error(unitTest.entries.length); | ||
const len = Object.keys(unitTest.groupIds).length; | ||
if (len !== 32) throw new Error(len); | ||
if (unitTest.dataCount !== 106 + 10 * hasCloudWatch) throw new Error(unitTest.dataCount); | ||
if (unitTest.dataCount !== 107 + 10 * hasCloudWatch) throw new Error(unitTest.dataCount); | ||
} | ||
@@ -768,0 +795,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1848842
67
4210