Use Logger for non-result output

This adds the Logger class for log output, all of which goes to STDERR,
and uses puts to send only the command result to STDOUT.
This commit is contained in:
barriserloth 2020-08-11 10:31:14 -07:00 committed by Austin Blatt
parent 4755343df2
commit 8ec90007ca
7 changed files with 81 additions and 67 deletions

11
lib/vmfloaty/logger.rb Normal file
View file

@ -0,0 +1,11 @@
require 'logger'
class FloatyLogger < ::Logger
def initialize
super(STDERR)
self.level = ::Logger::INFO
self.formatter = proc do |severity, datetime, progname, msg|
"#{msg}\n"
end
end
end