Do not print KeepAlive messages by default.

master
Philippe Pittoli 2024-02-20 23:24:52 +01:00
parent 4c07699082
commit 4b21c8bec1
1 changed files with 6 additions and 2 deletions

View File

@ -112,7 +112,9 @@ class AuthD::Service < IPC
end end
request_name = request.class.name.sub /^AuthD::Request::/, "" request_name = request.class.name.sub /^AuthD::Request::/, ""
if request_name != "KeepAlive" || @configuration.print_keepalive
Baguette::Log.debug "<< #{request_name} (FROM: #{event.fd})" Baguette::Log.debug "<< #{request_name} (FROM: #{event.fd})"
end
response = begin response = begin
request.handle self, event.fd request.handle self, event.fd
@ -143,9 +145,11 @@ class AuthD::Service < IPC
if response.is_a? AuthD::Response::Error if response.is_a? AuthD::Response::Error
Baguette::Log.warning ">> #{response_name} (#{response.reason}) (TO: #{event.fd})" Baguette::Log.warning ">> #{response_name} (#{response.reason}) (TO: #{event.fd})"
else else
if request_name != "KeepAlive" || @configuration.print_keepalive
Baguette::Log.debug ">> #{response_name} (TO: #{event.fd}) (Total duration: #{duration})" Baguette::Log.debug ">> #{response_name} (TO: #{event.fd}) (Total duration: #{duration})"
end end
end end
end
def get_user_from_token(token : String) def get_user_from_token(token : String)
token_payload = Token.from_s(@configuration.secret_key, token) token_payload = Token.from_s(@configuration.secret_key, token)