#include "RelayServer.h"
#include <Util.h>
#include <wx/init.h>
#include <wx/log.h>

int main(int argc, char** argv)
{
    wxInitializer initializer(argc, argv);
    if (!initializer.IsOk()) {
        fprintf(stderr, "Failed to initialize the wxWidgets library, aborting.");
        return -1;
    }
    auto* dl = wxLog::GetActiveTarget();
    dl->EnableLogging(true);
    dl->SetFormatter(new MLogFormatter());
    wxLog::SetLogLevel(wxLOG_Trace);

    auto server_ = std::make_unique<RelayServer>();
    if (server_->Init("127.0.0.1", 8080)) {
        server_->Run();
    }
    return 0;
}