Add debug mode in Env

This commit is contained in:
Thibault Jouan
2015-04-09 22:19:13 +00:00
parent f66d8d24ee
commit 7b11dd7b08
2 changed files with 27 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ module Uh
def_delegator :@output, :print
attr_reader :output
attr_accessor :verbose
attr_accessor :verbose, :debug
def initialize output
@output = output
@@ -20,6 +20,10 @@ module Uh
!!@verbose
end
def debug?
!!@debug
end
def logger
@logger ||= Logger.new(@output).tap do |o|
o.level = verbose? ? LOGGER_LEVEL_VERBOSE : LOGGER_LEVEL