From: Kefu Chai Date: Mon, 5 Jul 2021 02:09:05 +0000 (+0800) Subject: common/Graylog: assert(!m_hostname.empty()) in Graylog X-Git-Tag: v17.1.0~1463^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=baae90bd1325f783a6ff9d6d8177192be4c46320;p=ceph.git common/Graylog: assert(!m_hostname.empty()) in Graylog to verify that we always have a non-empty host field in log entry sent to graylog per the spec of GrayLog. see https://docs.graylog.org/en/4.0/pages/gelf.html#gelf-payload-specification Signed-off-by: Kefu Chai --- diff --git a/src/common/Graylog.cc b/src/common/Graylog.cc index accde0900a50..3e9da5fe85a2 100644 --- a/src/common/Graylog.cc +++ b/src/common/Graylog.cc @@ -58,6 +58,7 @@ void Graylog::set_destination(const std::string& host, int port) void Graylog::set_hostname(const std::string& host) { + assert(!host.empty()); m_hostname = host; }