add remote logging system using curl, normalize log messages removing \n, fix fra shaders precision issue, enable core and forward comp. in WGL, disable multisampling,

This commit is contained in:
2017-03-31 15:39:51 +01:00
parent ade95724e8
commit b1a3cb0309
18 changed files with 352 additions and 129 deletions

31
engine/log.h Normal file
View File

@@ -0,0 +1,31 @@
#pragma once
#include "util.h"
#ifdef __APPLE__
#define LOG(M,...) { printf(M"\n", ##__VA_ARGS__); LogRemote::I.log(M, ##__VA_ARGS__); }
#elif __ANDROID__
#define LOG(...) { ((void)__android_log_print(ANDROID_LOG_INFO, "native-engine", __VA_ARGS__)); LogRemote::I.log(__VA_ARGS__); }
#elif _WIN32
#define LOG(M,...) { printf(M"\n", ##__VA_ARGS__); LogRemote::I.log(M, ##__VA_ARGS__); }
#endif
class LogRemote
{
public:
static LogRemote I;
bool m_running;
std::thread m_thread;
ui::BlockingQueue<std::string> m_mq;
CURL *curl = nullptr;
CURLcode res;
std::string readBuffer;
std::string m_url = "http://omigamedev.ddns.net:8083";
int m_session;
void start();
void net_init();
std::string net_request(std::string cmd, std::string data = "");
void net_close();
void log(const char* format, ...);
~LogRemote();
};