Updated Readme and some other fixes.
This commit is contained in:
+13
-4
@@ -1,7 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
// easylogging includes
|
||||
#define ELPP_THREAD_SAFE
|
||||
#define ELPP_QT_LOGGING
|
||||
#define ELPP_NO_DEFAULT_LOG_FILE
|
||||
#include <easylogging++.h>
|
||||
#ifndef _DEBUG
|
||||
#define _DEBUG
|
||||
#define ELPP_THREAD_SAFE
|
||||
#define ELPP_QT_LOGGING
|
||||
#define ELPP_NO_DEFAULT_LOG_FILE
|
||||
#include <easylogging++.h>
|
||||
#undef _DEBUG
|
||||
#else
|
||||
#define ELPP_THREAD_SAFE
|
||||
#define ELPP_QT_LOGGING
|
||||
#define ELPP_NO_DEFAULT_LOG_FILE
|
||||
#include <easylogging++.h>
|
||||
#endif
|
||||
|
||||
+4
-2
@@ -52,9 +52,11 @@ int main(int argc, char *argv[]) {
|
||||
// Configure logger
|
||||
START_EASYLOGGINGPP(argc, argv);
|
||||
el::Loggers::addFlag(el::LoggingFlag::DisableApplicationAbortOnFatalLog);
|
||||
if (QFile::exists(logConfigFileName)) {
|
||||
el::Configurations conf(logConfigFileName);
|
||||
auto logconfigfile = QFileInfo(logConfigFileName).absoluteFilePath();
|
||||
if (QFile::exists(logconfigfile)) {
|
||||
el::Configurations conf(logconfigfile.toStdString());
|
||||
el::Loggers::reconfigureAllLoggers(conf);
|
||||
LOG(INFO) << "Log Config: " << QDir::toNativeSeparators(logconfigfile).toStdString();
|
||||
} else {
|
||||
el::Configurations conf;
|
||||
conf.parseFromText(logConfigDefault);
|
||||
|
||||
Reference in New Issue
Block a user