I have no idea whether this is idiomatic (or even valid) Ruby. Edit as you see fit.
What was the error generated? Both versions look fine to me.
The old version will put the arguments on separate lines.
The new version will put the arguments on the same line.
Putting the message and the list of instances on a single line is probably the best logging hygiene, since it’s all the same entry.
See the commit message.
The most recent push places all components of the message on a single line.
% bin/prune-dns invalid Traceback (most recent call last): 1: from bin/prune-dns:39:in `<main>' /opt/local/lib/ruby2.7/2.7.0/logger.rb:545:in `error': wrong number of arguments (given 4, expected 0..1) (ArgumentError)
% bin/prune-dns invalid E, [2021-08-26T23:17:22.025879 #15276] ERROR -- : Invalid EC2 instance ID. Expected each ID to be a 17-digit hexadecimal number sans leading i-. Received: ["invalid"]