Class: EnhancedLogger::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/enhanced_logger/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dest) ⇒ Logger

Returns a new instance of Logger.



5
6
7
# File 'lib/enhanced_logger/logger.rb', line 5

def initialize dest
  $stdout.sync = true
end

Instance Attribute Details

#levelObject

Returns the value of attribute level.



3
4
5
# File 'lib/enhanced_logger/logger.rb', line 3

def level
  @level
end

Instance Method Details

#clear_envObject



15
16
17
# File 'lib/enhanced_logger/logger.rb', line 15

def clear_env
  puts __method__
end

#debug(msg) ⇒ Object



33
34
35
# File 'lib/enhanced_logger/logger.rb', line 33

def debug msg
  puts formatted( msg )
end

#debug?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/enhanced_logger/logger.rb', line 29

def debug?
  true
end

#error(msg) ⇒ Object



37
38
39
# File 'lib/enhanced_logger/logger.rb', line 37

def error msg
  puts formatted( msg )
end

#fatal(msg) ⇒ Object



41
42
43
# File 'lib/enhanced_logger/logger.rb', line 41

def fatal msg
  puts formatted( msg )
end

#formatterObject



45
46
47
# File 'lib/enhanced_logger/logger.rb', line 45

def formatter
  ''
end

#info(msg = nil) ⇒ Object



19
20
21
22
23
# File 'lib/enhanced_logger/logger.rb', line 19

def info msg = nil
  return unless msg

  puts formatted( msg )
end

#info?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/enhanced_logger/logger.rb', line 25

def info?
  true
end

#set_env(env) ⇒ Object



9
10
11
12
13
# File 'lib/enhanced_logger/logger.rb', line 9

def set_env env
  puts __method__
  @request_id = env[ 'HTTP_X_REQUEST_ID' ]
  @remote_request_id = env[ 'HTTP_X_REMOTE_REQUEST_ID' ]
end