<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -478,8 +478,7 @@ module RedSteak
         msg = &quot;#{self.class} #{msg}&quot;
         @logger.puts msg
       when defined?(::Log4r) &amp;&amp; (Log4r::Logger === @logger)
-        msg ||= yield
-        @logger.send(@log_level || :debug, msg)
+        @logger.send(@log_level || :debug) { &quot;#{self.class} #{msg ||= yield}&quot; }
       end
     end
 </diff>
      <filename>lib/red_steak/builder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -89,7 +89,7 @@ module RedSteak
 
 
     def method_missing sel, *args
-      if args.size == 0 &amp;&amp; @options.key?(sel = sel.to_sym)
+      if args.empty? &amp;&amp; @options.key?(sel = sel.to_sym) &amp;&amp; ! block_given?
         @options[sel]
       else
         super</diff>
      <filename>lib/red_steak/error.rb</filename>
    </modified>
    <modified>
      <diff>@@ -344,7 +344,7 @@ module RedSteak
       state.ancestors.each do | s |
         s.outgoing.each do | trans |
           if (trigger = trans.matches_event?(event)) &amp;&amp;
-              trans.guard?(self, event_args) 
+              _guard?(trans, event_args) 
             result &lt;&lt; [ trans, trigger ]
             break if limit &amp;&amp; result.size &gt;= limit
           end
@@ -544,7 +544,7 @@ module RedSteak
 
       trans = @state.outgoing.select do | t |
         t.target == state &amp;&amp;
-          t.guard?(self, args)
+          _guard?(t, args)
       end
 
       trans
@@ -555,7 +555,7 @@ module RedSteak
     # where Transition#guard? is true.
     def valid_transitions *args
       @state.outgoing.select do | t |
-        t.guard?(self, args)
+        _guard?(t, args)
       end
     end
 
@@ -621,7 +621,7 @@ module RedSteak
 
         _log { &quot;transition! #{name.inspect}&quot; }
         
-        trans = nil unless @state === trans.source &amp;&amp; trans.guard?(self, args)
+        trans = nil unless @state === trans.source &amp;&amp; _guard?(trans, args)
       else
         name = trans
         name = name.to_sym unless Symbol === name
@@ -632,7 +632,7 @@ module RedSteak
         trans = @state.outgoing.select do | t |
           # $stderr.puts &quot;  testing t = #{t.inspect}&quot;
           t === name &amp;&amp;
-          t.guard?(self, args)
+          _guard?(t, args)
         end
 
         if trans.size &gt; 1
@@ -776,8 +776,17 @@ module RedSteak
     end
 
 
+    ##################################################################
+    # PRIVATE
+    #
+
     private
 
+    def _guard? t, args
+      _log { &quot;guard? #{t.inspect} =&gt; #{t.guard.inspect}&quot; }
+      t.guard?(self, args)
+    end
+
     # Queues a Transition for execution.
     #
     # This prevents recursion into the Machine.
@@ -886,7 +895,7 @@ module RedSteak
       # Behavior: Transition effect.
       _raise Error::UnexpectedRecursion, :effect if @in_effect
       @in_effect = true
-      _log { &quot;effect! #{trans.inspect}&quot; }
+      _log { &quot;effect! #{trans.inspect} =&gt; #{trans.effect.inspect}&quot; }
       trans.effect!(self, args)
       @in_effect = false
 
@@ -960,7 +969,7 @@ module RedSteak
       if old_state &amp;&amp; old_state != state
         (from - to).each do | s |
           if ! trans || trans.kind != :internal
-            _log { &quot;exit! #{s.inspect}&quot; }
+            _log { &quot;exit! #{s.inspect} =&gt; #{s.exit.inspect}&quot; }
             s.exit!(self, args)
           end
         end
@@ -979,7 +988,7 @@ module RedSteak
       if old_state != state
         (to - from).reverse.each do | s | 
           if ! trans || trans.kind != :internal
-            _log { &quot;entry! #{s.inspect}&quot; }
+            _log { &quot;entry! #{s.inspect} =&gt; #{s.entry.inspect}&quot; }
             s.entry!(self, args)
           end
         end</diff>
      <filename>lib/red_steak/machine.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6022c37727f736d88e402b45703bc2e70be34379</id>
    </parent>
  </parents>
  <author>
    <name>Kurt Stephens</name>
    <login>kstephens</login>
    <email>ks.github@kurtstephens.com</email>
  </author>
  <url>http://github.com/kstephens/red_steak/commit/0ed7a2e425d2ee2483ff9692e1cbf809e03a060d</url>
  <id>0ed7a2e425d2ee2483ff9692e1cbf809e03a060d</id>
  <committed-date>2009-05-08T22:29:02-07:00</committed-date>
  <authored-date>2009-05-08T22:29:02-07:00</authored-date>
  <message>Improved logging of behavior callbacks.</message>
  <tree>e9fb449da2df59b75b9707c1e1c95a3ef1d2530e</tree>
  <committer>
    <name>Kurt Stephens</name>
    <login>kstephens</login>
    <email>ks.github@kurtstephens.com</email>
  </committer>
</commit>
