mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-08 16:05:05 -04:00
Fixed all log levels.
This commit is contained in:
parent
0c3e3a8613
commit
188d58607c
1 changed files with 11 additions and 5 deletions
|
@ -52,7 +52,7 @@ const nonSettings = [
|
||||||
// config object after passing it to log4js.configure() because that method mutates the object. :(
|
// config object after passing it to log4js.configure() because that method mutates the object. :(
|
||||||
const defaultLogConfig = () => ({appenders: {console: {type: 'console'}},
|
const defaultLogConfig = () => ({appenders: {console: {type: 'console'}},
|
||||||
categories: {
|
categories: {
|
||||||
default: { appenders: ['console'], level: 'info'}
|
default: {appenders: ['console'], level: 'info'},
|
||||||
}});
|
}});
|
||||||
const defaultLogLevel = 'INFO';
|
const defaultLogLevel = 'INFO';
|
||||||
|
|
||||||
|
@ -60,8 +60,14 @@ const initLogging = (logLevel, config) => {
|
||||||
// log4js.configure() modifies exports.logconfig so check for equality first.
|
// log4js.configure() modifies exports.logconfig so check for equality first.
|
||||||
const logConfigIsDefault = deepEqual(config, defaultLogConfig());
|
const logConfigIsDefault = deepEqual(config, defaultLogConfig());
|
||||||
log4js.configure(config);
|
log4js.configure(config);
|
||||||
log4js.getLogger("console");
|
log4js.getLogger('console');
|
||||||
console.log = logger.info.bind(logger)
|
|
||||||
|
// Overwrites for console output methods
|
||||||
|
console.debug = logger.debug.bind(logger);
|
||||||
|
console.log = logger.info.bind(logger);
|
||||||
|
console.warn = logger.warn.bind(logger);
|
||||||
|
console.error = logger.error.bind(logger);
|
||||||
|
|
||||||
// Log the warning after configuring log4js to increase the chances the user will see it.
|
// Log the warning after configuring log4js to increase the chances the user will see it.
|
||||||
if (!logConfigIsDefault) logger.warn('The logconfig setting is deprecated.');
|
if (!logConfigIsDefault) logger.warn('The logconfig setting is deprecated.');
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue