Class: BitGirder::Core::BitGirderLogger
- Inherits:
-
Object
- Object
- BitGirder::Core::BitGirderLogger
- Defined in:
- lib/bitgirder/core.rb
Constant Summary collapse
- CODE =
Our log levels
:CODE- CONSOLE =
:CONSOLE- WARN =
:WARN- DEFAULT =
CONSOLE
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
Class Method Summary collapse
Instance Method Summary collapse
- #code(*argv) ⇒ Object (also: #debug)
- #console(*argv) ⇒ Object
-
#initialize ⇒ BitGirderLogger
constructor
A new instance of BitGirderLogger.
- #is_debug? ⇒ Boolean
- #warn(*argv) ⇒ Object
Constructor Details
#initialize ⇒ BitGirderLogger
Returns a new instance of BitGirderLogger.
51 52 53 |
# File 'lib/bitgirder/core.rb', line 51 def initialize @lock = Mutex.new end |
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
49 50 51 |
# File 'lib/bitgirder/core.rb', line 49 def level @level end |
Class Method Details
.get_logger ⇒ Object
134 135 136 |
# File 'lib/bitgirder/core.rb', line 134 def self.get_logger @logger end |
.is_debug_env_set? ⇒ Boolean
127 128 129 |
# File 'lib/bitgirder/core.rb', line 127 def self.is_debug_env_set? ( ENV[ ENV_BITGIRDER_DEBUG ] or "" ).strip =~ /^(true|yes)$/ end |
Instance Method Details
#code(*argv) ⇒ Object Also known as: debug
96 97 98 |
# File 'lib/bitgirder/core.rb', line 96 def code( *argv ) send_msg( CODE, Time.now, argv ) end |
#console(*argv) ⇒ Object
108 109 110 |
# File 'lib/bitgirder/core.rb', line 108 def console( *argv ) send_msg( CONSOLE, Time.now, argv ) end |
#is_debug? ⇒ Boolean
113 114 115 |
# File 'lib/bitgirder/core.rb', line 113 def is_debug? @level == CODE end |
#warn(*argv) ⇒ Object
103 104 105 |
# File 'lib/bitgirder/core.rb', line 103 def warn( *argv ) send_msg( WARN, Time.now, argv ) end |