Module: LogicTools::Traces

Included in:
Cover
Defined in:
lib/logic_tools/traces.rb

Constant Summary collapse

TRACES =

The logger used for displaying the traces.

Logger.new(STDOUT)
TRACES_INDENT =

The indent for the traces.

Indenter.new

Instance Method Summary collapse

Instance Method Details

#debug(&blk) ⇒ Object

Sends a debug-level trace.



98
99
100
# File 'lib/logic_tools/traces.rb', line 98

def debug(&blk)
    TRACES.debug(&blk)
end

#dec_indent(value = 1) ⇒ Object

Deacreases the indent level by value.



109
110
111
# File 'lib/logic_tools/traces.rb', line 109

def dec_indent(value = 1)
    TRACES_INDENT.dec(value)
end

#error(&blk) ⇒ Object

Sends an error-level trace.



83
84
85
# File 'lib/logic_tools/traces.rb', line 83

def error(&blk)
    TRACES.error(&blk)
end

#inc_indent(value = 1) ⇒ Object

Increases the indent level by value.



104
105
106
# File 'lib/logic_tools/traces.rb', line 104

def inc_indent(value = 1)
    TRACES_INDENT.inc(value)
end

#info(&blk) ⇒ Object

Sends an info-level trace.



93
94
95
# File 'lib/logic_tools/traces.rb', line 93

def info(&blk)
    TRACES.info(&blk)
end

#traces_debugObject

Sets the trace level to debug



77
78
79
# File 'lib/logic_tools/traces.rb', line 77

def traces_debug
    TRACES.level = Logger::DEBUG
end

#traces_errorObject

Sets the trace level to error.



62
63
64
# File 'lib/logic_tools/traces.rb', line 62

def traces_error
    TRACES.level = Logger::ERROR
end

#traces_infoObject

Sets the trace level to info.



72
73
74
# File 'lib/logic_tools/traces.rb', line 72

def traces_info
    TRACES.level = Logger::INFO
end

#traces_warnObject

Sets the trace level to warn.



67
68
69
# File 'lib/logic_tools/traces.rb', line 67

def traces_warn
    TRACES.level = Logger::WARN
end

#warn(&blk) ⇒ Object

Sends a warn-level trace.



88
89
90
# File 'lib/logic_tools/traces.rb', line 88

def warn(&blk)
    TRACES.warn(&blk)
end