diff options
author | Sadie Powell <sadie@witchery.services> | 2024-03-08 12:24:44 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-03-08 12:24:44 +0000 |
commit | 1d0a836a2ec3614b4eb94716f57a0d4a646cf860 (patch) | |
tree | e7391569968473b43f6d1f6c648890fe6d00338d /src/uplink.cpp | |
parent | 46b70648342daf1d3c482f24b14c125a31c0bfca (diff) |
Improve protocol debug messages.
Diffstat (limited to 'src/uplink.cpp')
-rw-r--r-- | src/uplink.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/uplink.cpp b/src/uplink.cpp index baa878db3..7e3322009 100644 --- a/src/uplink.cpp +++ b/src/uplink.cpp @@ -74,7 +74,33 @@ void Uplink::SendInternal(const Anope::map<Anope::string> &tags, const MessageSo return; UplinkSock->Write(message); - Log(LOG_RAWIO) << "Sent: " << message; + + Log(LOG_RAWIO) << "Sent " << message; + if (Anope::ProtocolDebug) + { + if (tags.empty()) + Log() << "\tNo tags"; + else + { + for (const auto &[tname, tvalue] : tags) + Log() << "\tTag " << tname << ": " << tvalue; + } + + if (source.GetSource().empty()) + Log() << "\tNo source"; + else + Log() << "\tSource: " << source.GetSource(); + + Log() << "\tCommand: " << command; + + if (params.empty()) + Log() << "\tNo params"; + else + { + for (size_t i = 0; i < params.size(); ++i) + Log() << "\tParam " << i << ": " << params[i]; + } + } } UplinkSocket::UplinkSocket() : Socket(-1, Config->Uplinks[Anope::CurrentUplink].protocol), ConnectionSocket(), BufferedSocket() |