Comparing version 6.4.0 to 6.4.1
@@ -71,5 +71,13 @@ const path = require('path'); | ||
if (appenderModule.appender) { | ||
process.emitWarning( | ||
`Appender ${appenderConfig.type} exports an appender function.`, | ||
"DeprecationWarning", "log4js-node-DEP0001" | ||
); | ||
debug(`DEPRECATION: Appender ${appenderConfig.type} exports an appender function.`); | ||
} | ||
if (appenderModule.shutdown) { | ||
process.emitWarning( | ||
`Appender ${appenderConfig.type} exports a shutdown function.`, | ||
"DeprecationWarning", "log4js-node-DEP0002" | ||
); | ||
debug(`DEPRECATION: Appender ${appenderConfig.type} exports a shutdown function.`); | ||
@@ -96,8 +104,9 @@ } | ||
Object.values(config.categories).forEach(category => { | ||
usedAppenders.push(...category.appenders) | ||
usedAppenders.push(...category.appenders); | ||
}); | ||
Object.keys(config.appenders).forEach((name) => { | ||
// dodgy hard-coding of special case for tcp-server which may not have | ||
// dodgy hard-coding of special case for tcp-server and multiprocess which may not have | ||
// any categories associated with it, but needs to be started up anyway | ||
if (usedAppenders.includes(name) || config.appenders[name].type === 'tcp-server') { | ||
if (usedAppenders.includes(name) || config.appenders[name].type === 'tcp-server' | ||
|| config.appenders[name].type === 'multiprocess') { | ||
getAppender(name, config); | ||
@@ -104,0 +113,0 @@ } |
@@ -5,2 +5,3 @@ const dateFormat = require('date-format'); | ||
const path = require('path'); | ||
const debug = require('debug')('log4js:layouts'); | ||
@@ -148,10 +149,36 @@ const styles = { | ||
// Pick up special cases | ||
if (format === 'ISO8601') { | ||
format = dateFormat.ISO8601_FORMAT; | ||
} else if (format === 'ISO8601_WITH_TZ_OFFSET') { | ||
format = dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT; | ||
} else if (format === 'ABSOLUTE') { | ||
format = dateFormat.ABSOLUTETIME_FORMAT; | ||
} else if (format === 'DATE') { | ||
format = dateFormat.DATETIME_FORMAT; | ||
switch (format) { | ||
case 'ISO8601': | ||
case 'ISO8601_FORMAT': | ||
format = dateFormat.ISO8601_FORMAT; | ||
break; | ||
case 'ISO8601_WITH_TZ_OFFSET': | ||
case 'ISO8601_WITH_TZ_OFFSET_FORMAT': | ||
format = dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT; | ||
break; | ||
case 'ABSOLUTE': | ||
process.emitWarning( | ||
"Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. " + | ||
"Please use %d{ABSOLUTETIME} instead.", | ||
"DeprecationWarning", "log4js-node-DEP0003" | ||
); | ||
debug("DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}."); | ||
// falls through | ||
case 'ABSOLUTETIME': | ||
case 'ABSOLUTETIME_FORMAT': | ||
format = dateFormat.ABSOLUTETIME_FORMAT; | ||
break; | ||
case 'DATE': | ||
process.emitWarning( | ||
"Pattern %d{DATE} is deprecated due to the confusion it causes when used. " + | ||
"Please use %d{DATETIME} instead.", | ||
"DeprecationWarning", "log4js-node-DEP0004" | ||
); | ||
debug("DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}."); | ||
// falls through | ||
case 'DATETIME': | ||
case 'DATETIME_FORMAT': | ||
format = dateFormat.DATETIME_FORMAT; | ||
break; | ||
// no default | ||
} | ||
@@ -158,0 +185,0 @@ } |
{ | ||
"name": "log4js", | ||
"version": "6.4.0", | ||
"version": "6.4.1", | ||
"description": "Port of Log4js to work with node.", | ||
@@ -8,3 +8,5 @@ "homepage": "https://log4js-node.github.io/log4js-node/", | ||
"lib", | ||
"types" | ||
"types", | ||
"CHANGELOG.md", | ||
"SECURITY.md" | ||
], | ||
@@ -20,3 +22,6 @@ "keywords": [ | ||
"types": "./types/log4js.d.ts", | ||
"author": "Gareth Jones <gareth.nomiddlename@gmail.com>", | ||
"contributors": [ | ||
"Gareth Jones <gareth.nomiddlename@gmail.com>", | ||
"Lam Wei Li <lam_wei_li@hotmail.com>" | ||
], | ||
"repository": { | ||
@@ -66,3 +71,3 @@ "type": "git", | ||
"tap": "^14.10.7", | ||
"typescript": "^4.5.4", | ||
"typescript": "^4.5.5", | ||
"validate-commit-msg": "^2.14.0" | ||
@@ -69,0 +74,0 @@ }, |
@@ -266,10 +266,5 @@ // Type definitions for log4js | ||
export interface AppenderModule { | ||
configure: (config: Config, layouts: LayoutsParam) => AppenderGenerator; | ||
configure: (config: Config, layouts: LayoutsParam) => AppenderFunction; | ||
} | ||
export type AppenderGenerator = ( | ||
layout: LayoutFunction, | ||
timezoneOffset?: string | ||
) => AppenderFunction; | ||
export type AppenderFunction = (loggingEvent: LoggingEvent) => void; | ||
@@ -325,3 +320,3 @@ | ||
levels: Level[]; | ||
getLevel(level: Level | string, defaultLevel: Level): Level; | ||
getLevel(level: Level | string, defaultLevel?: Level): Level; | ||
addLevels(customLevels: object): void; | ||
@@ -328,0 +323,0 @@ } |
@@ -136,3 +136,3 @@ import * as log4js from './log4js'; | ||
log4js.configure({ | ||
appenders: { thing: { type: { configure: () => {} }}}, | ||
appenders: { thing: { type: { configure: () => () => {} }}}, | ||
categories: { default: { appenders: ['thing'], level: 'debug'}} | ||
@@ -139,0 +139,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122066
33
2898