mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2024-11-22 19:25:16 +00:00
27 lines
No EOL
849 B
C++
27 lines
No EOL
849 B
C++
#pragma once
|
|
|
|
#include "SocketBase.hpp"
|
|
#include "types.h"
|
|
|
|
class Logger : public SocketBase {
|
|
public:
|
|
Logger(const char* ip, u16 port, const char* name) : SocketBase(name) {
|
|
this->init(ip, port);
|
|
};
|
|
nn::Result init(const char* ip, u16 port) override;
|
|
|
|
static void createInstance();
|
|
static void setLogName(const char *name) { if(sInstance) sInstance->setName(name); }
|
|
static void log(const char* fmt, ...);
|
|
static void log(const char* fmt, va_list args);
|
|
|
|
static void enableName() { if(sInstance) sInstance->isDisableName = false; }
|
|
static void disableName() { if(sInstance) sInstance->isDisableName = true; }
|
|
|
|
int read(char *out);
|
|
bool pingSocket();
|
|
|
|
private:
|
|
static Logger* sInstance;
|
|
bool isDisableName;
|
|
}; |