Class: LightGptProxy::Logger

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io, verbose:) ⇒ Logger

Returns a new instance of Logger.



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

def initialize(io, verbose:)
  @io = io
  @verbose = verbose
end

Instance Attribute Details

#ioObject (readonly)

Returns the value of attribute io.



10
11
12
# File 'lib/light_gpt_proxy/logger.rb', line 10

def io
  @io
end

#verboseObject (readonly)

Returns the value of attribute verbose.



10
11
12
# File 'lib/light_gpt_proxy/logger.rb', line 10

def verbose
  @verbose
end

Instance Method Details

#error(message, opts = {}) ⇒ Object



20
21
22
# File 'lib/light_gpt_proxy/logger.rb', line 20

def error(message, opts = {})
  log('ERROR', message, opts)
end

#info(message, opts = {}) ⇒ Object



12
13
14
# File 'lib/light_gpt_proxy/logger.rb', line 12

def info(message, opts = {})
  log('INFO', message, opts)
end

#warn(message, opts = {}) ⇒ Object



16
17
18
# File 'lib/light_gpt_proxy/logger.rb', line 16

def warn(message, opts = {})
  log('WARN', message, opts)
end