Class: BitGirder::Core::BitGirderLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/bitgirder/core.rb

Constant Summary collapse

CODE =

Our log levels

:CODE
CONSOLE =
:CONSOLE
WARN =
:WARN
DEFAULT =
CONSOLE

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBitGirderLogger

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

#levelObject

Returns the value of attribute level.



49
50
51
# File 'lib/bitgirder/core.rb', line 49

def level
  @level
end

Class Method Details

.get_loggerObject



134
135
136
# File 'lib/bitgirder/core.rb', line 134

def self.get_logger
    @logger
end

.is_debug_env_set?Boolean

Returns:

  • (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

Returns:

  • (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