f8/f8/tglog.h
aozhiwei 67387583e5 1
2022-12-16 17:58:33 +08:00

36 lines
1.1 KiB
C++

#pragma once
#include <a8/singleton.h>
namespace f8
{
struct TGLogImpl;
class TGLog : public a8::Singleton<TGLog>
{
private:
TGLog() {};
friend class a8::Singleton<TGLog>;
public:
void Init(const std::string& project_name, bool is_poly_log, int time_zone = 8);
void UnInit();
void SetProjectInfo(const std::string& project_name, bool is_poly_log, int time_zone = 8);
void AddTrackLog(int game_id, const std::string& accountid, unsigned long ip_saddr,
int logclass1, int logclass2, a8::XObject* prop);
void AddTrackLog(int game_id, const std::string& accountid, unsigned long ip_saddr,
const std::string& event_name, a8::XObject* prop);
private:
void SaveToFileThreadProc();
void InternalAddTrackLog(int game_id, const std::string& accountid, unsigned long ip_saddr,
const std::string& event_name, a8::XObject* prop);
private:
int time_zone_ = 0;
std::string project_name_;
bool is_poly_log_ = false;
TGLogImpl* impl_ = nullptr;
};
}