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.

Methods

call   log   summarize  

Configurations

force  [RW]  Force logging (false)

Public Instance methods

[Source]

    # 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
19:         
20:         log("#{app.var(task)} >>", "#{summarize output} (#{task.class})")
21:         output
22:       end

[Source]

    # 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

[Source]

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

[Validate]