diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b03de..cd81cf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # log4js-node changelog +## 4.1.1 +* [Add missing types for addLevels](https://github.com/log4js-node/log4js-node/pull/867) - thanks [@Ivkaa](https://github.com/Ivkaa) +* [Allow any return type for layout function](https://github.com/log4js-node/log4js-node/pull/845) - thanks [@xinbenlv](https://github.com/xinbenlv) + ## 4.1.0 * Updated streamroller to 1.0.4, to fix a bug where the inital size of an existing file was ignored when appending diff --git a/test/tap/configuration-validation-test.js b/test/tap/configuration-validation-test.js index 6a0a6aa..39c7789 100644 --- a/test/tap/configuration-validation-test.js +++ b/test/tap/configuration-validation-test.js @@ -297,6 +297,11 @@ test('log4js configuration validation', (batch) => { sandboxConfig.requires[ `${path.join(mainPath, '../../node_modules/nyc/bin/cheese')}` ] = testAppender('correct', result); + // in node v6, there's an extra layer of node modules for some reason, so add this one to work around it + sandboxConfig.requires[ + `${path.join(mainPath, '../../node_modules/tap/node_modules/nyc/bin/cheese')}` + ] = testAppender('correct', result); + const sandboxedLog4js = sandbox.require('../../lib/log4js', sandboxConfig); sandboxedLog4js.configure({ diff --git a/types/log4js.d.ts b/types/log4js.d.ts index 7ae36f5..c7f38d6 100644 --- a/types/log4js.d.ts +++ b/types/log4js.d.ts @@ -17,7 +17,7 @@ export function getLogger(category?: string): Logger; export function configure(filename: string): Log4js; export function configure(config: Configuration): Log4js; -export function addLayout(name: string, config: (a: any) => (logEvent: LoggingEvent) => string): void; +export function addLayout(name: string, config: (a: any) => (logEvent: LoggingEvent) => any): void; export function connectLogger(logger: Logger, options: { format?: Format; level?: string; nolog?: any; statusRules?: any[] }): any; // express.Handler; @@ -264,6 +264,7 @@ export interface Levels { OFF: Level; levels: Level[]; getLevel(level: string): Level; + addLevels(customLevels: object): void; } export interface Configuration {