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