mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-05-05 01:01:17 +00:00
28 lines
444 B
C++
28 lines
444 B
C++
#include "pch.h"
|
|
|
|
#ifdef LOGGING_ACTIVE
|
|
|
|
std::ofstream ofs;
|
|
log_level_t logLevel = LEVEL_NONE;
|
|
|
|
void logprintf(std::string logMsg, log_level_t level)
|
|
{
|
|
if (level < logLevel)
|
|
return;
|
|
|
|
ofs << GetTicks() << ": " << logMsg << '\n';
|
|
ofs.flush();
|
|
}
|
|
|
|
void prepareOfs(std::string fileName, log_level_t level)
|
|
{
|
|
logLevel = level;
|
|
ofs = std::ofstream(fileName, std::ios_base::out | std::ios_base::app);
|
|
}
|
|
|
|
void closeOfs()
|
|
{
|
|
ofs.close();
|
|
}
|
|
|
|
#endif |