MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / InitLog

Method InitLog

Source/Engine/Engine/Engine.cpp:565–626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563}
564
565void EngineImpl::InitLog()
566{
567#if LOG_ENABLE
568 // Initialize logger
569 Log::Logger::Init();
570
571 // Log build info
572 LOG(Info, "Flax Engine");
573#if BUILD_DEBUG
574 const Char* mode = TEXT("Debug");
575#elif BUILD_DEVELOPMENT
576 const Char* mode = TEXT("Development");
577#elif BUILD_RELEASE
578 const Char* mode = TEXT("Release");
579#endif
580 LOG(Info, "Platform: {0} {1} ({2})", ToString(PLATFORM_TYPE), ToString(PLATFORM_ARCH), mode);
581#if COMPILE_WITH_DEV_ENV
582 LOG(Info, "Compiled for Dev Environment");
583#endif
584#if defined(FLAXENGINE_BRANCH) && defined(FLAXENGINE_COMMIT)
585 LOG(Info, "Version " FLAXENGINE_VERSION_TEXT ", {}, {}", StringAsUTF16<>(FLAXENGINE_BRANCH).Get(), StringAsUTF16<>(FLAXENGINE_COMMIT).Get());
586#else
587 LOG(Info, "Version " FLAXENGINE_VERSION_TEXT);
588#endif
589 const Char* cpp = TEXT("?");
590 if (__cplusplus == 202101L) cpp = TEXT("C++23");
591 else if (__cplusplus == 202002L) cpp = TEXT("C++20");
592 else if (__cplusplus == 201703L) cpp = TEXT("C++17");
593 else if (__cplusplus == 201402L) cpp = TEXT("C++14");
594 else if (__cplusplus == 201103L) cpp = TEXT("C++11");
595 LOG(Info, "Compiled: {0} {1} {2}", TEXT(__DATE__), TEXT(__TIME__), cpp);
596#ifdef _MSC_VER
597 const String mcsVer = StringUtils::ToString(_MSC_FULL_VER);
598 LOG(Info, "Compiled with Visual C++ {0}.{1}.{2}.{3:0^2d}", mcsVer.Substring(0, 2), mcsVer.Substring(2, 2), mcsVer.Substring(4, 5), _MSC_BUILD);
599#elif defined(__clang__)
600 LOG(Info, "Compiled with Clang {0}.{1}.{2}", __clang_major__, __clang_minor__, __clang_patchlevel__);
601#elif defined(__GNUC__)
602 LOG(Info, "Compiled with GCC {0}.{1}.{2}", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
603#elif defined(__INTEL_COMPILER)
604 LOG(Info, "Compiled with Intel Compiler {0} {1}", __INTEL_COMPILER, __INTEL_COMPILER_BUILD_DATE);
605#else
606 LOG(Info, "Compiled with unrecognized C++ compiler");
607#endif
608
609 // Log product info
610 LOG(Info, "Product: {0}, Company: {1}", Globals::ProductName, Globals::CompanyName);
611 LOG(Info, "Current language: {}, culture: {}", Platform::GetUserLanguage(), Platform::GetUserLocaleName());
612 LOG(Info, "Command line: {0}", CommandLine);
613 LOG(Info, "Base folder: {0}", Globals::StartupFolder);
614 LOG(Info, "Binaries folder: {0}", Globals::BinariesFolder);
615 LOG(Info, "Temporary folder: {0}", Globals::TemporaryFolder);
616 LOG(Info, "Project folder: {0}", Globals::ProjectFolder);
617#if USE_EDITOR
618 LOG(Info, "Project name: {0}", Editor::Project->Name);
619#endif
620
621 // Log platform into
622 Platform::LogInfo();

Callers

nothing calls this directly

Calls 4

SubstringMethod · 0.80
InitFunction · 0.50
ToStringFunction · 0.50
GetMethod · 0.45

Tested by

no test coverage detected