Skip to content

Commit

Permalink
fix: configure logger instance only once
Browse files Browse the repository at this point in the history
  • Loading branch information
rcasta74 authored and M0Rf30 committed Aug 19, 2024
1 parent 0c4b103 commit 115e69c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions libs/pkcs11/src/LOGGER/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ Logger::~Logger() {
Logger* Logger::getInstance() throw() {
if (m_Instance == 0) {
m_Instance = new Logger();
}

int log_level = m_Instance->getLogConfig();
printf("Lib log level: %d\n", log_level);

if (log_level == LOG_STATUS_DISABLED) {
m_Instance->disableLog();
} else if (log_level > 0 && log_level < 3) {
m_Instance->enableFileLogging();
m_Instance->enableLog();
m_Instance->updateLogLevel(static_cast<LogLevel>(log_level));
int log_level = m_Instance->getLogConfig();
printf("Lib log level: %d\n", log_level);

if (log_level == LOG_STATUS_DISABLED) {
m_Instance->disableLog();
} else if (log_level > 0 && log_level < 3) {
m_Instance->enableFileLogging();
m_Instance->enableLog();
m_Instance->updateLogLevel(static_cast<LogLevel>(log_level));
}
}

return m_Instance;
Expand Down

0 comments on commit 115e69c

Please sign in to comment.