diff --git a/YACReaderLibrary/main.cpp b/YACReaderLibrary/main.cpp index 62f68584..f384ccd2 100644 --- a/YACReaderLibrary/main.cpp +++ b/YACReaderLibrary/main.cpp @@ -147,11 +147,11 @@ int main(int argc, char **argv) logger.setLoggingLevel(QsLogging::ErrorLevel); #endif - DestinationPtr fileDestination(DestinationFactory::MakeFileDestination( - destLog, EnableLogRotation, MaxSizeBytes(1048576), MaxOldLogCount(2))); - DestinationPtr debugDestination(DestinationFactory::MakeDebugOutputDestination()); - logger.addDestination(debugDestination); - logger.addDestination(fileDestination); + DestinationPtrU fileDestination(DestinationFactory::MakeFileDestination( + destLog, LogRotationOption::EnableLogRotation, MaxSizeBytes(1048576), MaxOldLogCount(2))); + DestinationPtrU debugDestination(DestinationFactory::MakeDebugOutputDestination()); + logger.addDestination(std::move(debugDestination)); + logger.addDestination(std::move(fileDestination)); QTranslator translator; QString sufix = QLocale::system().name(); @@ -232,7 +232,9 @@ int main(int argc, char **argv) if (YACReaderLocalServer::isRunning()) //s�lo se permite una instancia de YACReaderLibrary { QLOG_WARN() << "another instance of YACReaderLibrary is running"; - QsLogging::Logger::destroyInstance(); +#ifdef Q_OS_WIN + logger.shutDownLoggerThread(); +#endif return 0; } QLOG_INFO() << "YACReaderLibrary starting"; @@ -267,8 +269,8 @@ int main(int argc, char **argv) localServer->close(); delete localServer; delete mw; - - QsLogging::Logger::destroyInstance(); - +#ifdef Q_OS_WIN + logger.shutDownLoggerThread(); +#endif return ret; } diff --git a/YACReaderLibraryServer/main.cpp b/YACReaderLibraryServer/main.cpp index 26ae802d..e18ca87b 100644 --- a/YACReaderLibraryServer/main.cpp +++ b/YACReaderLibraryServer/main.cpp @@ -149,11 +149,11 @@ int main(int argc, char **argv) } } - DestinationPtr fileDestination(DestinationFactory::MakeFileDestination( - destLog, EnableLogRotation, MaxSizeBytes(1048576), MaxOldLogCount(2))); - DestinationPtr debugDestination(DestinationFactory::MakeDebugOutputDestination()); - logger.addDestination(debugDestination); - logger.addDestination(fileDestination); + DestinationPtrU fileDestination(DestinationFactory::MakeFileDestination( + destLog, LogRotationOption::EnableLogRotation, MaxSizeBytes(1048576), MaxOldLogCount(2))); + DestinationPtrU debugDestination(DestinationFactory::MakeDebugOutputDestination()); + logger.addDestination(std::move(debugDestination)); + logger.addDestination(std::move(fileDestination)); QTranslator translator; QString sufix = QLocale::system().name(); @@ -188,7 +188,9 @@ int main(int argc, char **argv) if (YACReaderLocalServer::isRunning()) //s�lo se permite una instancia de YACReaderLibrary { QLOG_WARN() << "another instance of YACReaderLibrary is running"; - QsLogging::Logger::destroyInstance(); +#ifdef Q_OS_WIN + logger.shutDownLoggerThread(); +#endif return 0; } QLOG_INFO() << "YACReaderLibrary starting"; @@ -208,9 +210,9 @@ int main(int argc, char **argv) delete s; localServer->close(); delete localServer; - - QsLogging::Logger::destroyInstance(); - +#ifdef Q_OS_WIN + logger.shutDownLoggerThread(); +#endif return ret; } else if (command == "create-library") { parser.clearPositionalArguments();