mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-03 17:39:02 +00:00
24 lines
479 B
C++
24 lines
479 B
C++
namespace LX
|
|
{
|
|
template<typename... Args>
|
|
inline void SafeLog(std::ofstream* log, Args... args)
|
|
{
|
|
if (log != nullptr)
|
|
{
|
|
(*log << ... << args);
|
|
(*log << '\n');
|
|
}
|
|
}
|
|
|
|
inline void SafeFlush(std::ofstream* log)
|
|
{
|
|
if (log != nullptr)
|
|
{
|
|
log->flush();
|
|
}
|
|
}
|
|
|
|
// Gives a standard way to mark a change between different sections within the log output //
|
|
constexpr const char* LOG_BREAK = "\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n";
|
|
}
|