mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
Merge pull request #1164 from log4js-node/emit-deprecation
emit deprecation
This commit is contained in:
commit
49c91738ea
@ -68,9 +68,17 @@ const createAppender = (name, config) => {
|
||||
`appender "${name}" is not valid (type "${appenderConfig.type}" could not be found)`
|
||||
);
|
||||
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.`);
|
||||
}
|
||||
|
||||
|
||||
@ -155,6 +155,11 @@ function patternLayout(pattern, tokens) {
|
||||
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':
|
||||
@ -162,6 +167,11 @@ function patternLayout(pattern, tokens) {
|
||||
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':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user