Class: Charyf::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/charyf/utils/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(logdev, shift_age = 0, shift_size = 1048576) ⇒ Logger

Returns a new instance of Logger.



7
8
9
10
11
12
13
14
15
# File 'lib/charyf/utils/logger.rb', line 7

def initialize(logdev, shift_age = 0, shift_size = 1048576)
  super

  self.datetime_format = '%Y-%m-%d %H:%M:%S'

  self.formatter = proc do |severity, datetime, progname, msg|
    "#{datetime} [#{severity}]: #{msg}\n"
  end
end

Instance Method Details

#flow_request(msg) ⇒ Object



17
18
19
# File 'lib/charyf/utils/logger.rb', line 17

def flow_request(msg)
  info(msg.green)
end

#flow_response(msg) ⇒ Object



21
22
23
# File 'lib/charyf/utils/logger.rb', line 21

def flow_response(msg)
  info(msg.blue)
end