summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Dahlin <cdahlin@redhat.com>2008-10-07 10:27:12 -0400
committerCasey Dahlin <cdahlin@redhat.com>2008-10-07 10:27:12 -0400
commit4578965df38401a58fb7573ab5f33ef0600dbd67 (patch)
tree391ffa124ce625bb75931be0e8b15fbd3c26c169
parentf694d2f5240cbc847b0f765ee5d8e76f71d7f814 (diff)
downloadupstate-4578965df38401a58fb7573ab5f33ef0600dbd67.tar.gz
upstate-4578965df38401a58fb7573ab5f33ef0600dbd67.tar.xz
upstate-4578965df38401a58fb7573ab5f33ef0600dbd67.zip
Added trace method
Added a new trace method to output debuginfo
-rw-r--r--state.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/state.rb b/state.rb
index 951c259..b842184 100644
--- a/state.rb
+++ b/state.rb
@@ -21,6 +21,13 @@ module UpState
# Occurs when the state machine becomes inconsistent
class ConsistencyFault < StandardError; end
+ENABLE_TRACE = false
+
+def trace(*args)
+ return unless ENABLE_TRACE
+ $stderr.puts *args
+end
+
=begin rdoc
An instance of State exists whenever a state can become true without having to
toggle any other states, or whenever a state _is_ true.