Top Level Namespace
Defined Under Namespace
Modules: JSON, Rubocoin Classes: Blockchain, Hash
Instance Method Summary collapse
-
#debug(msg = '', descriptor = $stdout) ⇒ Object
Prints
msgto the given descriptor in the form of “[DEBUG] - msg”. -
#debug_with_timestamp(msg = '', descriptor = $stdout) ⇒ Object
Prints an debug message with a timestamp prepended to it Example: 2005-03-19 15:10:26,618 - [DEBUG] - msg.
-
#error(msg = '', descriptor = $stdout) ⇒ Object
Prints
msgto the given descriptor in the form of “[ERROR] - msg”. -
#error_with_timestamp(msg = '', descriptor = $stdout) ⇒ Object
Prints an error message with a timestamp prepended to it Example: 2005-03-19 15:10:26,618 - [ERROR] - msg.
-
#info(msg = '', descriptor = $stdout) ⇒ Object
Prints
msgto the given descriptor in the form of “[INFO] - msg”. -
#info_with_timestamp(msg = '', descriptor = $stdout) ⇒ Object
Prints an informational message with a timestamp prepended to it Example: 2005-03-19 15:10:26,618 - [INFO] - msg.
-
#new_with_timestamp(msg = '', descriptor = $stdout) ⇒ Object
Prints a ‘NEW’ message with a timestamp prepended to it.
-
#print_new(msg = '', descriptor = $stdout) ⇒ Object
Prints
msgto the given descriptor in the form of “[NEW] - msg”.
Instance Method Details
#debug(msg = '', descriptor = $stdout) ⇒ Object
Prints msg to the given descriptor in the form of “[DEBUG] - msg”
28 29 30 |
# File 'lib/rubocoin/text/print_utils.rb', line 28 def debug(msg = '', descriptor = $stdout) descriptor.puts("[#{'DEBUG'.yellow}] - #{msg}") end |
#debug_with_timestamp(msg = '', descriptor = $stdout) ⇒ Object
Prints an debug message with a timestamp prepended to it Example: 2005-03-19 15:10:26,618 - [DEBUG] - msg
35 36 37 |
# File 'lib/rubocoin/text/print_utils.rb', line 35 def (msg = '', descriptor = $stdout) descriptor.puts("#{Time.now} - [#{'DEBUG'.yellow}] - #{msg}") end |
#error(msg = '', descriptor = $stdout) ⇒ Object
Prints msg to the given descriptor in the form of “[ERROR] - msg”
16 17 18 |
# File 'lib/rubocoin/text/print_utils.rb', line 16 def error(msg = '', descriptor = $stdout) descriptor.puts("[#{'ERROR'.red}] - #{msg}") end |
#error_with_timestamp(msg = '', descriptor = $stdout) ⇒ Object
Prints an error message with a timestamp prepended to it Example: 2005-03-19 15:10:26,618 - [ERROR] - msg
23 24 25 |
# File 'lib/rubocoin/text/print_utils.rb', line 23 def (msg = '', descriptor = $stdout) descriptor.puts("#{Time.now} - [#{'ERROR'.blue}] - #{msg}") end |
#info(msg = '', descriptor = $stdout) ⇒ Object
Prints msg to the given descriptor in the form of “[INFO] - msg”
4 5 6 |
# File 'lib/rubocoin/text/print_utils.rb', line 4 def info(msg = '', descriptor = $stdout) descriptor.puts("[#{'INFO'.blue}] - #{msg}") end |
#info_with_timestamp(msg = '', descriptor = $stdout) ⇒ Object
Prints an informational message with a timestamp prepended to it Example: 2005-03-19 15:10:26,618 - [INFO] - msg
11 12 13 |
# File 'lib/rubocoin/text/print_utils.rb', line 11 def (msg = '', descriptor = $stdout) descriptor.puts("#{Time.now} - [#{'INFO'.blue}] - #{msg}") end |
#new_with_timestamp(msg = '', descriptor = $stdout) ⇒ Object
Prints a ‘NEW’ message with a timestamp prepended to it. Usually used for new blocks being formed Example: 2005-03-19 15:10:26,618 - [NEW] - msg
48 49 50 |
# File 'lib/rubocoin/text/print_utils.rb', line 48 def (msg = '', descriptor = $stdout) descriptor.puts("#{Time.now} - [#{'NEW'.green}] - #{msg}") end |
#print_new(msg = '', descriptor = $stdout) ⇒ Object
Prints msg to the given descriptor in the form of “[NEW] - msg”
40 41 42 |
# File 'lib/rubocoin/text/print_utils.rb', line 40 def print_new(msg = '', descriptor = $stdout) descriptor.puts("[#{'NEW'.green}] - #{msg}") end |