diff options
author | sfan5 <sfan5@live.de> | 2020-04-08 20:13:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-08 20:13:23 +0200 |
commit | de73f989eb1397b1103236031fd91309b294583c (patch) | |
tree | b2fae6ebca2468b17f7d9648eb63625b6b3712c1 /src/client/client.h | |
parent | 3494475df108e3401c6c8463a0aeae0f227fd1fa (diff) | |
download | hax-minetest-server-de73f989eb1397b1103236031fd91309b294583c.tar.gz hax-minetest-server-de73f989eb1397b1103236031fd91309b294583c.zip |
Overall improvements to log messages (#9598)
Hide some unnecessarily verbose ones behind --trace or disable them entirely.
Remove duplicate ones. Improve their contents in some places.
Diffstat (limited to 'src/client/client.h')
-rw-r--r-- | src/client/client.h | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/client/client.h b/src/client/client.h index 1291b944c..eea78d456 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -82,30 +82,19 @@ public: void add(u16 command) { - std::map<u16, u16>::iterator n = m_packets.find(command); - if(n == m_packets.end()) - { + auto n = m_packets.find(command); + if (n == m_packets.end()) m_packets[command] = 1; - } else - { n->second++; - } } void clear() { - for (auto &m_packet : m_packets) { - m_packet.second = 0; - } + m_packets.clear(); } - void print(std::ostream &o) - { - for (const auto &m_packet : m_packets) { - o << "cmd "<< m_packet.first <<" count "<< m_packet.second << std::endl; - } - } + void print(std::ostream &o) const; private: // command, count |