|
@@ -20,10 +20,14 @@ void initLog(QString ModuleName, CLHQLogApi& lhQLog)
|
|
|
/* 创建一个文件sink,每天一个,00:00创建新的 */
|
|
|
// auto sink_file = std::make_shared<spdlog::sinks::daily_file_sink_mt>("FlowChartLog/log.txt",0,0);
|
|
|
/* 自定义的sink */
|
|
|
- #if C_DEBUG
|
|
|
- QString libName = QCoreApplication::applicationDirPath() + "/LHQLogd.dll";
|
|
|
- #elif C_RELEASE
|
|
|
- QString libName = QCoreApplication::applicationDirPath() + "/LHQLog.dll";
|
|
|
+ #if defined(Q_OS_WIN32)
|
|
|
+ #if C_DEBUG
|
|
|
+ QString libName = QApplication::applicationDirPath() + "/LHQLogd.dll";
|
|
|
+ #elif C_RELEASE
|
|
|
+ QString libName = QApplication::applicationDirPath() + "/LHQLog.dll";
|
|
|
+ #endif
|
|
|
+ #elif defined(Q_OS_LINUX)
|
|
|
+ QString libName = QApplication::applicationDirPath() + "/libLHQLog.so";
|
|
|
#endif
|
|
|
auto sink_custom = std::make_shared<spdlog::sinks::LHLog_file_sink_mt>(&lhQLog, libName, ModuleName);
|
|
|
/* 给默认记录器用的sink */
|