2017-01-20 08:36:52 -05:00
|
|
|
#pragma once
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
namespace Components
|
|
|
|
{
|
|
|
|
class Logger : public Component
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Logger();
|
|
|
|
~Logger();
|
|
|
|
|
2018-12-17 08:29:18 -05:00
|
|
|
static void MessagePrint(int channel, const std::string& message);
|
2017-01-19 16:23:59 -05:00
|
|
|
static void Print(int channel, const char* message, ...);
|
|
|
|
static void Print(const char* message, ...);
|
2018-12-17 08:29:18 -05:00
|
|
|
static void ErrorPrint(int error, const std::string& message);
|
2017-01-19 16:23:59 -05:00
|
|
|
static void Error(const char* message, ...);
|
|
|
|
static void Error(int error, const char* message, ...);
|
|
|
|
static void SoftError(const char* message, ...);
|
|
|
|
static bool IsConsoleReady();
|
|
|
|
|
|
|
|
static void PrintStub(int channel, const char* message, ...);
|
|
|
|
|
2018-12-17 08:29:18 -05:00
|
|
|
static void PipeOutput(void(*callback)(const std::string&));
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
static void Flush();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static std::mutex MessageMutex;
|
|
|
|
static std::vector<std::string> MessageQueue;
|
|
|
|
static std::vector<Network::Address> LoggingAddresses[2];
|
2018-12-17 08:29:18 -05:00
|
|
|
static void(*PipeCallback)(const std::string&);
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
static void Frame();
|
|
|
|
static void GameLogStub();
|
|
|
|
static void PrintMessageStub();
|
|
|
|
static void PrintMessagePipe(const char* data);
|
2018-12-17 08:29:18 -05:00
|
|
|
static void EnqueueMessage(const std::string& message);
|
2017-01-19 16:23:59 -05:00
|
|
|
|
2017-02-24 19:17:11 -05:00
|
|
|
static void BuildOSPathStub();
|
|
|
|
static void RedirectOSPath(const char* file, char* folder);
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
static void NetworkLog(const char* data, bool gLog);
|
|
|
|
|
|
|
|
static std::string Format(const char** message);
|
|
|
|
};
|
|
|
|
}
|