network: Migrate logging macros (#3575)

* network: Migrate logging macros

Follow-up of #3533

Replace prefix of all logging macros from LOG to NGLOG

* Remove hash in format
This commit is contained in:
Daniel Lim Wee Soong 2018-03-27 19:00:14 +08:00 committed by Merry
parent 4bdf2e1eb9
commit 3e8e011c33
2 changed files with 8 additions and 7 deletions

View file

@ -15,12 +15,12 @@ static std::shared_ptr<Room> g_room; ///< Room (Server) for network
bool Init() { bool Init() {
if (enet_initialize() != 0) { if (enet_initialize() != 0) {
LOG_ERROR(Network, "Error initalizing ENet"); NGLOG_ERROR(Network, "Error initalizing ENet");
return false; return false;
} }
g_room = std::make_shared<Room>(); g_room = std::make_shared<Room>();
g_room_member = std::make_shared<RoomMember>(); g_room_member = std::make_shared<RoomMember>();
LOG_DEBUG(Network, "initialized OK"); NGLOG_DEBUG(Network, "initialized OK");
return true; return true;
} }
@ -44,7 +44,7 @@ void Shutdown() {
g_room.reset(); g_room.reset();
} }
enet_deinitialize(); enet_deinitialize();
LOG_DEBUG(Network, "shutdown OK"); NGLOG_DEBUG(Network, "shutdown OK");
} }
} // namespace Network } // namespace Network

View file

@ -408,8 +408,9 @@ void Room::RoomImpl::HandleWifiPacket(const ENetEvent* event) {
if (member != members.end()) { if (member != members.end()) {
enet_peer_send(member->peer, 0, enet_packet); enet_peer_send(member->peer, 0, enet_packet);
} else { } else {
LOG_ERROR(Network, NGLOG_ERROR(Network,
"Attempting to send to unknown MAC address: %02X:%02X:%02X:%02X:%02X:%02X", "Attempting to send to unknown MAC address: "
"{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}",
destination_address[0], destination_address[1], destination_address[2], destination_address[0], destination_address[1], destination_address[2],
destination_address[3], destination_address[4], destination_address[5]); destination_address[3], destination_address[4], destination_address[5]);
enet_packet_destroy(enet_packet); enet_packet_destroy(enet_packet);