Skip to content

Instantly share code, notes, and snippets.

@j1n6
Created January 3, 2014 12:55
Show Gist options
  • Save j1n6/8237477 to your computer and use it in GitHub Desktop.
Save j1n6/8237477 to your computer and use it in GitHub Desktop.
Ruby Multiple IO
class MultipleIO
def initialize(*targets)
@targets = targets
end
def write(*args)
@targets.each { |t| t.write(*args) }
end
def close
@targets.each(&:close)
end
end
Hulk::Application.configure do
# ...
# other config settings for development
# ...
log_file = File.open("log/development.log", "a")
config.logger = Logger.new MultiIO.new(STDOUT, log_file)
config.logger.level = Logger.const_get('DEBUG')
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment