lib/trifle/logger/tracer/hash.rb in trifle-logger-0.1.2 vs lib/trifle/logger/tracer/hash.rb in trifle-logger-0.1.3
- old
+ new
@@ -2,19 +2,20 @@
module Trifle
module Logger
module Tracer
class Hash
- attr_accessor :key, :meta, :data, :tags, :artifacts, :state
+ attr_accessor :key, :meta, :data, :tags, :artifacts, :state, :ignore
def initialize(key:, meta: nil)
@key = key
@meta = meta
@data = []
@tags = []
@artifacts = []
@state = :success
+ @ignore = false
@result_prefix = '=> '
trace("Trifle::Trace has been initialized for #{key}")
end
@@ -72,11 +73,15 @@
def success?
@state == :success
end
+ def ignore!
+ @ignore = true
+ end
+
def wrapup
- Trifle::Logger.default.on_wrapup(self)
+ Trifle::Logger.default.on_wrapup(self) unless @ignore
end
end
end
end
end