2017-10-10 23:32:13 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
|
|
|
#include <mutex>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "../rc/util_rc.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Logger
|
|
|
|
*
|
2017-10-10 23:44:06 +02:00
|
|
|
* Logger for one DLL. Creates a text file and
|
|
|
|
* writes all log messages to that file.
|
2017-10-10 23:32:13 +02:00
|
|
|
*/
|
2017-10-10 23:44:06 +02:00
|
|
|
class Logger {
|
2017-10-10 23:32:13 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2017-10-10 23:44:06 +02:00
|
|
|
Logger(const std::string& file_name);
|
|
|
|
~Logger();
|
2017-10-10 23:32:13 +02:00
|
|
|
|
2017-10-10 23:44:06 +02:00
|
|
|
static void trace(const std::string& message);
|
|
|
|
static void info (const std::string& message);
|
|
|
|
static void warn (const std::string& message);
|
|
|
|
static void err (const std::string& message);
|
2017-10-10 23:32:13 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
std::mutex m_mutex;
|
2017-10-10 23:44:06 +02:00
|
|
|
std::ofstream m_fileStream;
|
2017-10-10 23:32:13 +02:00
|
|
|
|
2017-10-10 23:44:06 +02:00
|
|
|
void log(const std::string& message);
|
|
|
|
|
2017-10-10 23:32:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|