- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document
C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+
Build status: BUILD_RTI=OFF successful (0 errors, warnings only)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
89 lines
2.7 KiB
C++
Executable File
89 lines
2.7 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Logger handling stuff for NGL(Core|Gui)Application
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
#pragma once
|
|
|
|
#include <QtCore/QByteArray>
|
|
#include <QtCore/QString>
|
|
|
|
#ifndef LOGGERHANDLER_EXPORT
|
|
# ifdef BUILD_STATIC_LIBRARIES
|
|
# define LOGGERHANDLER_EXPORT
|
|
# else
|
|
# if defined(MAKE_NGLCOREAPPLICATION_LIB) || defined(MAKE_NGLGUIAPPLICATION_LIB) || defined(MAKE_NGLAPPLICATION_LIB) || defined(MAKE_NGLSINGLECOREAPPLICATION_LIB) || defined(MAKE_NGLSINGLEAPPLICATION_LIB)
|
|
# define LOGGERHANDLER_EXPORT Q_DECL_EXPORT
|
|
# else
|
|
# define LOGGERHANDLER_EXPORT Q_DECL_IMPORT
|
|
# endif
|
|
# endif
|
|
#endif
|
|
|
|
namespace NGL
|
|
{
|
|
class INGLLogger;
|
|
|
|
class LOGGERHANDLER_EXPORT LoggerHandler
|
|
{
|
|
public:
|
|
LoggerHandler() = default;
|
|
~LoggerHandler() = default;
|
|
|
|
/**
|
|
* @brief Creates a NGL RootLogger instance, using baseName as the name for the base logger and configFileName for the .props file
|
|
* @param baseName the name of the service/application
|
|
* @param configFileName The file name with the logging informations
|
|
* @param checkTime the time (in seconds) to check for modifications of the file
|
|
*/
|
|
void createLogger(const QByteArray &baseName,
|
|
const char *configFileName,
|
|
bool quiet = false);
|
|
|
|
/**
|
|
* @brief Creates a NGL RootLogger instance, using <svcName>.main as the base logger name,
|
|
* configFileName is created with 'log4cxx_<svcNameLowerCase>.props'
|
|
* @param baseName the name of the service/application
|
|
* @param exerciseId the (optional) exercise id, if > 0,
|
|
* @param additionalId an (optional) id to be used for logfile name creation,
|
|
* the output log name is created with ${USER}_<svcNameLowerCase>_<exerciseId>.log
|
|
*/
|
|
void createLogger(const QByteArray &baseName,
|
|
int exerciseId = 0,
|
|
int additionalId = 0,
|
|
bool quiet = false);
|
|
|
|
/**
|
|
* @brief get the base Logger created with createLogger()
|
|
*/
|
|
NGL::INGLLogger &baseLogger() const;
|
|
|
|
/**
|
|
* @brief Get a logger with the given name
|
|
* @param The logger to retrieve
|
|
*/
|
|
NGL::INGLLogger &logger(const char *loggerName) const;
|
|
|
|
/**
|
|
* @brief get the log filename postfix (e.g. /shd/CTC/log/ctc_foo)
|
|
*/
|
|
QString loggerNamePostfix() const { return m_loggerFilenamePostfix; }
|
|
|
|
/**
|
|
* @brief get the log filename prefix (e.g. .log)
|
|
*/
|
|
QString loggerNamePrefix() const { return m_loggerFilenamePrefix; }
|
|
|
|
/**
|
|
* @brief Retrieves the loggerhandler from ngl(core)application or nullptr
|
|
*/
|
|
static LoggerHandler *getLoggerHandler();
|
|
private:
|
|
QByteArray m_baseLoggerName;
|
|
QString m_loggerFilenamePostfix;
|
|
QString m_loggerFilenamePrefix;
|
|
};
|
|
} // namespace NGL
|