diff options
Diffstat (limited to 'src/appMain/main.cc')
-rw-r--r-- | src/appMain/main.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/appMain/main.cc b/src/appMain/main.cc index 34c5b4dbfa..cedaf50497 100644 --- a/src/appMain/main.cc +++ b/src/appMain/main.cc @@ -43,7 +43,15 @@ // ---------------------------------------------------------------------------- #ifdef ENABLE_LOG + +#ifdef LOG4CXX_LOGGER +#include "utils/appenders_loader.h" #include "utils/logger/log4cxxlogger.h" + +#else // LOG4CXX_LOGGER +#include "utils/logger/boostlogger.h" +#endif // LOG4CXX_LOGGER + #include "utils/logger/logger_impl.h" #endif // ENABLE_LOG @@ -53,7 +61,6 @@ #include "signal_handlers.h" #include "config_profile/profile.h" -#include "utils/appenders_loader.h" #include "utils/signals.h" #include "utils/system.h" @@ -142,18 +149,24 @@ int32_t main(int32_t argc, char** argv) { if (profile_instance.logs_enabled()) { // Logger initialization // Redefine for each paticular logger implementation +#ifdef LOG4CXX_LOGGER auto logger = std::unique_ptr<logger::Log4CXXLogger>( new logger::Log4CXXLogger("log4cxx.properties")); + + if (!utils::appenders_loader.Loaded()) { + SDL_LOG_ERROR("Appenders plugin not loaded, file logging disabled"); + } +#else // LOG4CXX_LOGGER + auto logger = std::unique_ptr<logger::BoostLogger>( + new logger::BoostLogger("boostlogconfig.ini")); +#endif // LOG4CXX_LOGGER + logger_impl->Init(std::move(logger)); } #endif threads::Thread::SetNameForId(threads::Thread::CurrentId(), "SDLCore"); - if (!utils::appenders_loader.Loaded()) { - SDL_LOG_ERROR("Appenders plugin not loaded, file logging disabled"); - } - SDL_LOG_INFO("Application started!"); SDL_LOG_INFO("SDL version: " << profile_instance.sdl_version()); |