40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <a8/singleton.h>
|
|
|
|
namespace f8
|
|
{
|
|
|
|
class UdpLog : public a8::Singleton<UdpLog>
|
|
{
|
|
private:
|
|
UdpLog();
|
|
friend class a8::Singleton<UdpLog>;
|
|
|
|
public:
|
|
~UdpLog();
|
|
|
|
void Init();
|
|
void UnInit();
|
|
|
|
void SetLogFileName(const std::string& filename);
|
|
|
|
void Emergency(const char *format, std::initializer_list<a8::XValue> args);
|
|
void Alert(const char *format, std::initializer_list<a8::XValue> args);
|
|
void Error(const char *format, std::initializer_list<a8::XValue> args);
|
|
void Warning(const char *format, std::initializer_list<a8::XValue> args);
|
|
void Notice(const char *format, std::initializer_list<a8::XValue> args);
|
|
void Info(const char *format, std::initializer_list<a8::XValue> args);
|
|
void Debug(const char *format, std::initializer_list<a8::XValue> args);
|
|
|
|
private:
|
|
void SendLog(const char *category, const char *format,
|
|
std::initializer_list<a8::XValue>& args);
|
|
void SaveToFileThreadProc();
|
|
|
|
private:
|
|
struct UdpLogImpl* impl_ = nullptr;
|
|
};
|
|
|
|
}
|