Use Logger to log errors, don't log errors in specs

parent 3853cf65
Pipeline #217 passed with stage
in 1 minute
......@@ -10,6 +10,8 @@ end
PubRelay.private_key = OpenSSL::RSA.new(File.read(File.join(__DIR__, "test_actor.pem")))
PubRelay.host = "example.com"
PubRelay.logger.level = Logger::WARN
def request(method, resource, headers = nil, body = nil)
request = HTTP::Request.new(method, resource, headers, body)
......
......@@ -248,7 +248,7 @@ class InboxHandler
end
private def error(status_code, message)
puts "ERROR: #{message} #{status_code}"
PubRelay.logger.info "Returned error to client: #{message} #{status_code}"
response.status_code = status_code
response.puts message
......
......@@ -25,6 +25,8 @@ class PubRelay
class_property(host) { ENV["RELAY_DOMAIN"] }
class_property logger = Logger.new(STDOUT)
def call(context : HTTP::Server::Context)
case {context.request.method, context.request.path}
when {"GET", "/.well-known/webfinger"}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment