Don't print KeepAlive messages by default.

This commit is contained in:
Philippe Pittoli 2024-02-20 23:28:58 +01:00
parent 2b3fe276a5
commit a708d8fc46

View File

@ -76,7 +76,9 @@ class DNSManager::Service < IPC
end
reqname = request.class.name.sub /^DNSManager::Request::/, ""
Baguette::Log.debug "<< #{reqname}"
if reqname != "KeepAlive" || @configuration.print_keepalive
Baguette::Log.debug "<< #{reqname}"
end
response = begin
request.handle self, event
@ -105,9 +107,11 @@ class DNSManager::Service < IPC
response_name = response.class.name.sub /^DNSManager::Response::/, ""
if response.is_a? DNSManager::Response::Error
Baguette::Log.warning ">> #{response_name} (#{response.reason})"
Baguette::Log.warning ">> #{response_name} (#{response.reason}) (Total duration: #{duration})"
else
Baguette::Log.debug ">> #{response_name} (Total duration: #{duration})"
if reqname != "KeepAlive" || @configuration.print_keepalive
Baguette::Log.debug ">> #{response_name} (Total duration: #{duration})"
end
end
end