lib/dldinternet/mixlib/logging.rb in dldinternet-mixlib-logging-0.1.8 vs lib/dldinternet/mixlib/logging.rb in dldinternet-mixlib-logging-0.2.0
- old
+ new
@@ -131,22 +131,23 @@
match = caller_rgxp.match(stack[caller_index])
file = match[1]
line = Integer(match[2])
modl = match[3] unless match[3].nil?
+ # Unless we've already logged this TODO ...
unless @TODO["#{file}::#{line}"]
le = ::Logging::LogEvent.new(@logger, ::Logging::LEVELS['todo'], msg, false)
@logger.logEvent(le)
- @TODO["#{file}::#{line}"] = true
+ @TODO["#{file}::#{line}"] = msg
end
end
# -----------------------------------------------------------------------------
- def logStep(msg)
+ def logStep(msg,cat='Step')
logger = getLogger(@logger_args, 'logStep')
if logger
- logger.step "Resource #{@step+=1}: #{msg} ..."
+ logger.step "#{cat} #{@step+=1}: #{msg} ..."
end
end
# -----------------------------------------------------------------------------
# Set up logger
@@ -174,11 +175,10 @@
end
begin
::Logging.init :trace, :debug, :info, :step, :warn, :error, :fatal, :todo unless defined? ::Logging::MAX_LEVEL_LENGTH
if args[:origins] and args[:origins][:log_level]
- if (::Logging::LEVELS[args[:log_level].to_s] and ::Logging::LEVELS[args[:log_level].to_s] < 2)
- #puts "#{args[:log_level].to_s} = #{::Logging::LEVELS[args[:log_level].to_s]}".light_yellow
+ if ::Logging::LEVELS[args[:log_level].to_s] and ::Logging::LEVELS[args[:log_level].to_s] < 2
puts "#{args[:origins][:log_level]} says #{args[:log_level]}".light_yellow
else
from = ''
end
end