Adds latest migration results
This commit is contained in:
829 files changed
+35074
-70886
No files matched your search
@@ -7,6 +7,7 @@
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
#ifdef HAVE_LOG4QT
|
||||
#include <log4qt/logger.h>
|
||||
#include <log4qt/logmanager.h>
|
||||
#include <log4qt/loggerrepository.h>
|
||||
@@ -15,6 +16,7 @@
|
||||
#include <log4qt/helpers/configuratorhelper.h>
|
||||
#include <log4qt/helpers/properties.h>
|
||||
#include <log4qt/helpers/factory.h>
|
||||
#endif
|
||||
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
@@ -34,16 +36,20 @@ void LtsRollingFileAppender::activateOptions()
|
||||
{
|
||||
if (!m_ltsLogfileName.isEmpty())
|
||||
setFile(m_ltsLogfileName);
|
||||
#ifdef HAVE_LOG4QT
|
||||
Log4Qt::RollingFileAppender::activateOptions();
|
||||
#endif
|
||||
}
|
||||
|
||||
QString LtsRollingFileAppender::m_ltsLogfileName;
|
||||
#ifdef HAVE_LOG4QT
|
||||
static Log4Qt::Appender *createLtsRollingFileAppender()
|
||||
{
|
||||
auto ret = new LtsRollingFileAppender;
|
||||
ret->setAppendFile(true);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -98,6 +104,7 @@ NGL::NGLLogger::NGLLogger(const std::string &fullqualifiedname)
|
||||
, currentLevel(LogLevel::Undefined)
|
||||
, m_bNoSpace(true)
|
||||
{
|
||||
#ifdef HAVE_LOG4QT
|
||||
if (!fullqualifiedname.empty())
|
||||
{
|
||||
logger_ptr = Log4Qt::LogManager::loggerRepository()->logger(QString::fromStdString(name));
|
||||
@@ -108,7 +115,7 @@ NGL::NGLLogger::NGLLogger(const std::string &fullqualifiedname)
|
||||
logger_ptr = Log4Qt::LogManager::loggerRepository()->rootLogger();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
configChanged();
|
||||
}
|
||||
@@ -147,7 +154,31 @@ NGL::INGLLogger &NGL::NGLLogger::getNGLLogger(const std::string &fullqualifiedna
|
||||
|
||||
void NGL::NGLLogger::log(LogLevel level, const INGLLogger::String &message, const char *file, int line, const char *function)
|
||||
{
|
||||
#ifdef HAVE_LOG4QT
|
||||
logger_ptr->logWithLocation(static_cast<Log4Qt::Level::Value>(level), file, line, function, QString::fromStdString(message));
|
||||
#else
|
||||
// Stub implementation - use qDebug/qWarning/qCritical based on level
|
||||
Q_UNUSED(file);
|
||||
Q_UNUSED(line);
|
||||
Q_UNUSED(function);
|
||||
const QString msg = QString::fromStdString(message);
|
||||
switch (level)
|
||||
{
|
||||
case LogLevel::Fatal:
|
||||
case LogLevel::Error:
|
||||
qCritical() << msg;
|
||||
break;
|
||||
case LogLevel::Warning:
|
||||
qWarning() << msg;
|
||||
break;
|
||||
case LogLevel::Info:
|
||||
case LogLevel::Debug:
|
||||
case LogLevel::Trace:
|
||||
default:
|
||||
qDebug() << msg;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -302,6 +333,7 @@ NGL::NGLLogger &NGL::NGLLogger::createNGLRootLogger(const QString &configfilenam
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_LOG4QT
|
||||
Log4Qt::Factory::registerAppender("Lts::RollingFileAppender", createLtsRollingFileAppender);
|
||||
LtsRollingFileAppender::setLtsLogfileName(logOutputName);
|
||||
|
||||
@@ -337,6 +369,14 @@ NGL::NGLLogger &NGL::NGLLogger::createNGLRootLogger(const QString &configfilenam
|
||||
Log4Qt::PropertyConfigurator::configure(props);
|
||||
}
|
||||
rootlogger_ptr->configChanged();
|
||||
#else
|
||||
// Stub implementation - no logging initialization needed
|
||||
Q_UNUSED(configfilename);
|
||||
Q_UNUSED(ignorealreadycreated);
|
||||
Q_UNUSED(logOutputName);
|
||||
Q_UNUSED(quiet);
|
||||
rootlogger_ptr = new NGLLogger(std::string());
|
||||
#endif
|
||||
}
|
||||
return *rootlogger_ptr;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user