Skip to content

Commit

Permalink
Using BasicConfigurator should prevent default configuration (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
swebb2066 authored Jan 17, 2025
1 parent 72ba404 commit 0c5ffd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/cpp/basicconfigurator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void BasicConfigurator::configure(const LayoutPtr& layoutArg)
auto layout = layoutArg;
if (!layout)
{
static const helpers::WideLife<LogString> TTCC_CONVERSION_PATTERN(LOG4CXX_STR("%r [%t] %p %c %x - %m%n"));
LogString TTCC_CONVERSION_PATTERN{LOG4CXX_STR("%r [%t] %p %c %x - %m%n")};
layout = std::make_shared<PatternLayout>(TTCC_CONVERSION_PATTERN);
}
auto appender = std::make_shared<ConsoleAppender>(layout);
Expand All @@ -39,6 +39,7 @@ void BasicConfigurator::configure(const LayoutPtr& layoutArg)

void BasicConfigurator::configure(const AppenderPtr& appender)
{
LogManager::getLoggerRepository()->setConfigured(true);
LoggerPtr root = Logger::getRootLogger();
root->addAppender(appender);
}
Expand Down

0 comments on commit 0c5ffd5

Please sign in to comment.