68 lines
1.3 KiB
C++
Executable File
68 lines
1.3 KiB
C++
Executable File
|
|
|
|
#pragma once
|
|
|
|
#include <QByteArray>
|
|
#include <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;
|
|
|
|
|
|
|
|
void createLogger(const QByteArray &baseName,
|
|
const char *configFileName,
|
|
bool quiet = false);
|
|
|
|
|
|
|
|
void createLogger(const QByteArray &baseName,
|
|
int exerciseId = 0,
|
|
int additionalId = 0,
|
|
bool quiet = false);
|
|
|
|
|
|
|
|
NGL::INGLLogger &baseLogger() const;
|
|
|
|
|
|
|
|
NGL::INGLLogger &logger(const char *loggerName) const;
|
|
|
|
|
|
|
|
QString loggerNamePostfix() const { return m_loggerFilenamePostfix; }
|
|
|
|
|
|
|
|
QString loggerNamePrefix() const { return m_loggerFilenamePrefix; }
|
|
|
|
|
|
|
|
static LoggerHandler *getLoggerHandler();
|
|
private:
|
|
QByteArray m_baseLoggerName;
|
|
QString m_loggerFilenamePostfix;
|
|
QString m_loggerFilenamePrefix;
|
|
};
|
|
}
|