Class Tap::Middlewares::Debugger
In: lib/tap/middlewares/debugger.rb
Parent: Middleware

Logs the execution of tasks with their inputs. Debugger outputs the same information as App.exe will output when the app is set to debug. To avoid duplication, debugger ONLY logs execution when the app is not in debug mode, or when force is set.


call   log   summarize  


force  [RW]  Force logging (false)

Public Instance methods


    # File lib/tap/middlewares/debugger.rb, line 16
16:       def call(task, input)
17:         log("#{app.var(task)} <<", "#{summarize input} (#{task.class})")
18:         output = super
20:         log("#{app.var(task)} >>", "#{summarize output} (#{task.class})")
21:         output
22:       end


    # File lib/tap/middlewares/debugger.rb, line 24
24:       def log(action, msg)
25:         if force || !app.debug
26:           app.log(action, msg)
27:         end
28:       end


    # File lib/tap/middlewares/debugger.rb, line 30
30:       def summarize(obj)
31:         obj.inspect
32:       end