Commit f4c116e4 authored by Filip Hauzvic's avatar Filip Hauzvic
Browse files

Use AGE logging system

parent 8204a2a9
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#include <iostream>
#include <ostream>
#include <span>
#include <utils/log.hpp>

namespace net
{
@@ -53,7 +54,7 @@ bool GNSSocket::start_server(int port, int max_connections)
    if (!GameNetworkingSockets_Init(nullptr, err_msg))
    {
        m_status = ConnectionStatus::DISCONNECTED;
        cerr << err_msg << endl;
        LOG(LSL_ERROR, err_msg);
        return false;
    }

@@ -62,7 +63,7 @@ bool GNSSocket::start_server(int port, int max_connections)
    {
        GameNetworkingSockets_Kill();
        m_status = ConnectionStatus::DISCONNECTED;
        cerr << "Failed to get SteamNetworkingSockets interface" << endl;
        LOG(LSL_ERROR, "Failed to get SteamNetworkingSockets interface");
        return false;
    }

@@ -77,7 +78,7 @@ bool GNSSocket::start_server(int port, int max_connections)
    if (m_impl->listen_socket == k_HSteamListenSocket_Invalid)
    {
        shutdown();
        cerr << "Failed to create listen socket" << endl;
        LOG(LSL_ERROR, "Failed to create listen socket");
        return false;
    }

@@ -85,7 +86,7 @@ bool GNSSocket::start_server(int port, int max_connections)
    if (m_impl->poll_group == k_HSteamNetPollGroup_Invalid)
    {
        shutdown();
        cerr << "Failed to create poll group" << endl;
        LOG(LSL_ERROR, "Failed to create poll group");
        return false;
    }

@@ -115,7 +116,7 @@ bool GNSSocket::start_client(std::string address, int port)
    if (!GameNetworkingSockets_Init(nullptr, err_msg))
    {
        m_status = ConnectionStatus::DISCONNECTED;
        cerr << err_msg << endl;
        LOG(LSL_ERROR, err_msg);
        return false;
    }

@@ -124,7 +125,7 @@ bool GNSSocket::start_client(std::string address, int port)
    {
        GameNetworkingSockets_Kill();
        m_status = ConnectionStatus::DISCONNECTED;
        cerr << "Failed to get SteamNetworkingSockets interface" << endl;
        LOG(LSL_ERROR, "Failed to get SteamNetworkingSockets interface");
        return false;
    }

@@ -132,7 +133,7 @@ bool GNSSocket::start_client(std::string address, int port)
    if (m_impl->poll_group == k_HSteamNetPollGroup_Invalid)
    {
        shutdown();
        cerr << "Failed to create poll group" << endl;
        LOG(LSL_ERROR, "Failed to create poll group");
        return false;
    }

@@ -140,7 +141,7 @@ bool GNSSocket::start_client(std::string address, int port)
    if (!server_addr.ParseString(address.c_str()))
    {
        shutdown();
        cerr << "Failed to parse server address: " << address << endl;
        LOG(LSL_ERROR, "Failed to parse server address" << address);
        return false;
    }
    server_addr.m_port = static_cast<uint16_t>(port);
@@ -152,7 +153,7 @@ bool GNSSocket::start_client(std::string address, int port)
    if (connection == k_HSteamNetConnection_Invalid)
    {
        shutdown();
        cerr << "Failed to connect to server" << endl;
        LOG(LSL_ERROR, "Failed to connect to server");
        return false;
    }

@@ -160,7 +161,7 @@ bool GNSSocket::start_client(std::string address, int port)
    {
        m_impl->interface->CloseConnection(connection, 0, "Failed to set poll group", false);
        shutdown();
        cerr << "Failed to set connection poll group" << endl;
        LOG(LSL_ERROR, "Failed to set poll group");
        return false;
    }

+1 −1

File changed.

Contains only whitespace changes.