lib/semantic_logger/appender/udp.rb in semantic_logger-4.2.0 vs lib/semantic_logger/appender/udp.rb in semantic_logger-4.2.1
- old
+ new
@@ -80,23 +80,22 @@
true
end
# Flush is called by the semantic_logger during shutdown.
def flush
- @socket.flush if @socket
+ @socket&.flush
end
# Close is called during shutdown, or with reopen
def close
- @socket.close if @socket
+ @socket&.close
end
private
# Returns [SemanticLogger::Formatters::Default] formatter default for this Appender
def default_formatter
SemanticLogger::Formatters::Json.new
end
-
end
end
end