mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-09 04:46:07 +01:00
40 lines
643 B
C
40 lines
643 B
C
|
#pragma once
|
||
|
|
||
|
#include <fstream>
|
||
|
#include <iostream>
|
||
|
#include <mutex>
|
||
|
#include <string>
|
||
|
|
||
|
#include "../rc/util_rc.h"
|
||
|
|
||
|
namespace dxvk {
|
||
|
|
||
|
/**
|
||
|
* \brief Logger
|
||
|
*
|
||
|
* Logs messages generated by DXVK and
|
||
|
* the client APIs using DXVK.
|
||
|
*/
|
||
|
class Log : public RcObject {
|
||
|
|
||
|
public:
|
||
|
|
||
|
Log(const std::string& filename);
|
||
|
~Log();
|
||
|
|
||
|
/**
|
||
|
* \brief Adds a message to the log
|
||
|
*
|
||
|
* Prints the message to stderr and appends
|
||
|
* it to the log file at the same time.
|
||
|
*/
|
||
|
void log(const std::string& message);
|
||
|
|
||
|
private:
|
||
|
|
||
|
std::mutex m_mutex;
|
||
|
std::fstream m_stream;
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|