mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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.
This commit is contained in:
parent
3494475df1
commit
de73f989eb
22 changed files with 87 additions and 111 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue