mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-26 10:24:14 +08:00
33 lines
656 B
C++
33 lines
656 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <mutex>
|
|
#include <cstdio>
|
|
#include <chrono>
|
|
|
|
class dbg_log
|
|
{
|
|
private:
|
|
std::recursive_mutex f_mtx{};
|
|
std::string filepath{};
|
|
std::FILE *out_file{};
|
|
const std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now();
|
|
|
|
void open();
|
|
void write_stamp();
|
|
|
|
public:
|
|
dbg_log(std::string_view path);
|
|
dbg_log(std::wstring_view path);
|
|
~dbg_log();
|
|
|
|
void write(std::string_view str);
|
|
void write(std::wstring_view str);
|
|
|
|
void write(const char* fmt, ...);
|
|
void write(const wchar_t* fmt, ...);
|
|
|
|
void close();
|
|
};
|