#pragma once namespace f8 { struct TGLogImpl; class TGLog : public a8::Singleton { private: TGLog() {}; friend class a8::Singleton; 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; }; }