aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/logger.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/logger.rb b/lib/logger.rb
index 4ccc03b614..0615546d18 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -479,9 +479,7 @@ class Logger
# device exists, return +nil+.
#
def <<(msg)
- unless @logdev.nil?
- @logdev.write(msg)
- end
+ @logdev&.write(msg)
end
#
@@ -568,7 +566,7 @@ class Logger
# Close the logging device.
#
def close
- @logdev.close if @logdev
+ @logdev&.close
end
private