Class: VGH::Output
- Inherits:
-
Object
- Object
- VGH::Output
- Defined in:
- lib/vgh/output.rb
Overview
Description:
This class sends messages to STDOUT
or to a log file. It takes the following standard methods:
-
debug
-
info
-
warn
-
error
-
fatal
If stdout
is called then the message is only sent to STDOUT
.
If header
or footer
is called then it displays them.
Usage:
# Load output
= Output.new
.header
.info "Starting code"
# Your code here
.info "End code"
.
Instance Attribute Summary collapse
-
#debug(message) ⇒ Object
readonly
Writes a debug log message and outputs to screen.
-
#error(message) ⇒ Object
readonly
Writes an error log message and outputs to screen.
-
#fatal(message) ⇒ Object
readonly
Writes a fatal log message and outputs to screen.
-
#footer ⇒ Object
readonly
Returns the footer.
-
#header ⇒ Object
readonly
Returns the header.
-
#info(message) ⇒ Object
readonly
Writes an info log message and outputs to screen.
-
#warn(message) ⇒ Object
readonly
Writes an warn log message and outputs to screen.
Instance Method Summary collapse
-
#stdout(message) ⇒ Object
Outputs a message to screen.
Instance Attribute Details
#debug(message) ⇒ Object (readonly)
Writes a debug log message and outputs to screen
38 39 40 |
# File 'lib/vgh/output.rb', line 38 def debug @debug end |
#error(message) ⇒ Object (readonly)
Writes an error log message and outputs to screen
44 45 46 |
# File 'lib/vgh/output.rb', line 44 def error @error end |
#fatal(message) ⇒ Object (readonly)
Writes a fatal log message and outputs to screen
46 47 48 |
# File 'lib/vgh/output.rb', line 46 def fatal @fatal end |
#footer ⇒ Object (readonly)
Returns the footer
50 51 52 |
# File 'lib/vgh/output.rb', line 50 def @footer end |
#header ⇒ Object (readonly)
Returns the header
48 49 50 |
# File 'lib/vgh/output.rb', line 48 def header @header end |
#info(message) ⇒ Object (readonly)
Writes an info log message and outputs to screen
40 41 42 |
# File 'lib/vgh/output.rb', line 40 def info @info end |
#warn(message) ⇒ Object (readonly)
Writes an warn log message and outputs to screen
42 43 44 |
# File 'lib/vgh/output.rb', line 42 def warn @warn end |
Instance Method Details
#stdout(message) ⇒ Object
Outputs a message to screen
83 84 85 |
# File 'lib/vgh/output.rb', line 83 def stdout() puts if verbose? end |