Skip to content

Commit

Permalink
Merge pull request #1210 from log4js-node/optimise
Browse files Browse the repository at this point in the history
chore(optimise): do not initialise default appenders as it will be done again by configure()
  • Loading branch information
lamweili committed Mar 15, 2022
2 parents 5d171f4 + 4b40052 commit e58a48a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/appenders/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ const createAppender = (name, config) => {
const setup = (config) => {
appenders.clear();
appendersLoading.clear();
if (!config) {
return;
}

const usedAppenders = [];
Object.values(config.categories).forEach(category => {
usedAppenders.push(...category.appenders);
Expand All @@ -114,7 +118,7 @@ const setup = (config) => {
};

const init = () => {
setup({ appenders: { out: { type: 'stdout' } }, categories: { default: { appenders: ['out'], level: 'trace' } } });
setup();
};
init();

Expand Down

0 comments on commit e58a48a

Please sign in to comment.