iw4x-client/src/Components/Modules/Logger.hpp

43 lines
1.2 KiB
C++
Raw Normal View History

2015-12-23 16:21:03 -05:00
namespace Components
{
class Logger : public Component
{
public:
Logger();
2016-08-15 10:40:30 -04:00
~Logger();
2016-09-16 05:04:28 -04:00
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
2015-12-23 16:21:03 -05:00
const char* GetName() { return "Logger"; };
2016-08-15 10:40:30 -04:00
#endif
2016-06-03 18:06:07 -04:00
static void MessagePrint(int channel, std::string message);
static void Print(int channel, const char* message, ...);
2015-12-23 16:21:03 -05:00
static void Print(const char* message, ...);
2016-06-03 18:06:07 -04:00
static void ErrorPrint(int error, std::string message);
2015-12-23 16:21:03 -05:00
static void Error(const char* message, ...);
2016-06-03 18:06:07 -04:00
static void Error(int error, const char* message, ...);
2015-12-23 16:21:03 -05:00
static void SoftError(const char* message, ...);
static bool IsConsoleReady();
2016-09-17 08:05:01 -04:00
static void PrintStub(int channel, const char* message, ...);
2016-02-17 16:21:42 -05:00
static void PipeOutput(void(*callback)(std::string));
2016-09-03 07:42:14 -04:00
private:
static std::mutex MessageMutex;
static std::vector<std::string> MessageQueue;
2016-09-03 09:52:40 -04:00
static std::vector<Network::Address> LoggingAddresses[2];
2016-02-17 16:21:42 -05:00
static void(*PipeCallback)(std::string);
static void Frame();
2016-09-03 09:52:40 -04:00
static void GameLogStub();
2016-02-17 16:21:42 -05:00
static void PrintMessageStub();
static void PrintMessagePipe(const char* data);
2016-09-03 07:42:14 -04:00
static void EnqueueMessage(std::string message);
2016-06-03 18:06:07 -04:00
2016-09-03 09:52:40 -04:00
static void NetworkLog(const char* data, bool gLog);
2016-06-03 18:06:07 -04:00
static std::string Format(const char** message);
2015-12-23 16:21:03 -05:00
};
}