mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 22:45:18 +01:00
31 lines
647 B
C++
31 lines
647 B
C++
#ifndef TGCALLS_LOG_SINK_IMPL_H
|
|
#define TGCALLS_LOG_SINK_IMPL_H
|
|
|
|
#include "rtc_base/logging.h"
|
|
#include <fstream>
|
|
|
|
namespace tgcalls {
|
|
|
|
struct FilePath;
|
|
|
|
class LogSinkImpl final : public rtc::LogSink {
|
|
public:
|
|
LogSinkImpl(const FilePath &logPath);
|
|
|
|
void OnLogMessage(const std::string &msg, rtc::LoggingSeverity severity, const char *tag) override;
|
|
void OnLogMessage(const std::string &message, rtc::LoggingSeverity severity) override;
|
|
void OnLogMessage(const std::string &message) override;
|
|
|
|
std::string result() const {
|
|
return _data.str();
|
|
}
|
|
|
|
private:
|
|
std::ofstream _file;
|
|
std::ostringstream _data;
|
|
|
|
};
|
|
|
|
} // namespace tgcalls
|
|
|
|
#endif
|