From f9bf8e59e0df13f3f3750181581eb48782b524cd Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 6 Aug 2023 11:30:37 +0100 Subject: [PATCH] use conditional assignment --- lib/voicemeeter/logger.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/voicemeeter/logger.rb b/lib/voicemeeter/logger.rb index dce0e10..892f5c4 100644 --- a/lib/voicemeeter/logger.rb +++ b/lib/voicemeeter/logger.rb @@ -3,7 +3,7 @@ require "logger" module Voicemeeter module Logging def logger - @logger = Logger.new($stdout, level: ENV.fetch("VM_LOG_LEVEL", "WARN")) + @logger ||= Logger.new($stdout, level: ENV.fetch("VM_LOG_LEVEL", "WARN")) @logger.progname = instance_of?(::Module) ? name : self.class.name @logger end