Fix logging environment causing pointer corruption
Some checks failed
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 5m46s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 5m30s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 6m16s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 6m14s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 6m27s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 6m23s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 7m40s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 7m49s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 6m13s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 6m13s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 7m21s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 7m10s
Bigfoot / Clang Format Checks (push) Failing after 12s
Some checks failed
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 5m46s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 5m30s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 6m16s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 6m14s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 6m27s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 6m23s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 7m40s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 7m49s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 6m13s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 6m13s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 7m21s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 7m10s
Bigfoot / Clang Format Checks (push) Failing after 12s
This commit is contained in:
@@ -41,18 +41,6 @@ class Log
|
||||
Log(const Log& p_logger) = delete;
|
||||
Log(Log&& p_logger) = delete;
|
||||
|
||||
/**
|
||||
* Starts the logger backend
|
||||
*
|
||||
*/
|
||||
void Start();
|
||||
|
||||
/**
|
||||
* Stops the logger backend
|
||||
*
|
||||
*/
|
||||
void Stop();
|
||||
|
||||
/**
|
||||
* Register a logger.
|
||||
*
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace Bigfoot
|
||||
{
|
||||
Log::Log()
|
||||
{
|
||||
quill::Backend::start();
|
||||
|
||||
m_sinks[static_cast<std::size_t>(Flat::LogSinkType::Console)] =
|
||||
quill::Frontend::create_or_get_sink<quill::ConsoleSink>(
|
||||
std::string {Flat::EnumNameLogSinkType(Flat::LogSinkType::Console)});
|
||||
@@ -19,21 +21,6 @@ Log::Log()
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
void Log::Start()
|
||||
{
|
||||
quill::Backend::start();
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
void Log::Stop()
|
||||
{
|
||||
Flush();
|
||||
quill::Backend::stop();
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
quill::Logger* Log::RegisterLogger(const LoggerInfo& p_loggerInfo)
|
||||
{
|
||||
quill::Logger* logger = quill::Frontend::create_or_get_logger(
|
||||
@@ -114,10 +101,12 @@ void Log::Flush()
|
||||
|
||||
Log::~Log()
|
||||
{
|
||||
Flush();
|
||||
for (quill::Logger* logger: quill::Frontend::get_all_loggers())
|
||||
{
|
||||
quill::Frontend::remove_logger(logger);
|
||||
quill::Frontend::remove_logger_blocking(logger);
|
||||
}
|
||||
quill::Backend::stop();
|
||||
}
|
||||
} // namespace Bigfoot
|
||||
#endif
|
||||
|
||||
@@ -16,15 +16,15 @@ class TestingEnvironment: public ::testing::Environment
|
||||
public:
|
||||
void SetUp() override
|
||||
{
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(Singleton<Log>::GetInstance().Start());
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.emplace());
|
||||
}
|
||||
|
||||
void TearDown() override
|
||||
{
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(Singleton<Log>::GetInstance().Stop());
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.reset());
|
||||
}
|
||||
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(Singleton<Log>::Lifetime m_lifetime);
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(eastl::optional<Singleton<Log>::Lifetime> m_lifetime);
|
||||
};
|
||||
} // namespace Bigfoot
|
||||
|
||||
|
||||
@@ -16,15 +16,15 @@ class TestingEnvironment: public ::testing::Environment
|
||||
public:
|
||||
void SetUp() override
|
||||
{
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(Singleton<Log>::GetInstance().Start());
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.emplace());
|
||||
}
|
||||
|
||||
void TearDown() override
|
||||
{
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(Singleton<Log>::GetInstance().Stop());
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.reset());
|
||||
}
|
||||
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(Singleton<Log>::Lifetime m_lifetime);
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(eastl::optional<Singleton<Log>::Lifetime> m_lifetime);
|
||||
};
|
||||
} // namespace Bigfoot
|
||||
|
||||
|
||||
@@ -16,15 +16,15 @@ class TestingEnvironment: public ::testing::Environment
|
||||
public:
|
||||
void SetUp() override
|
||||
{
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(Singleton<Log>::GetInstance().Start());
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.emplace());
|
||||
}
|
||||
|
||||
void TearDown() override
|
||||
{
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(Singleton<Log>::GetInstance().Stop());
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.reset());
|
||||
}
|
||||
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(Singleton<Log>::Lifetime m_lifetime);
|
||||
BIGFOOT_NOT_OPTIMIZED_ONLY(eastl::optional<Singleton<Log>::Lifetime> m_lifetime);
|
||||
};
|
||||
} // namespace Bigfoot
|
||||
|
||||
|
||||
Reference in New Issue
Block a user