Module: OnlyofficeBugzillaHelper::LoggerWrapper
- Included in:
- BugzillaHelper
- Defined in:
- lib/onlyoffice_bugzilla_helper/logger_wrapper.rb
Overview
Logger module for logging stuff
Instance Method Summary collapse
-
#hide_keys(string) ⇒ String
Hide sensitive info.
-
#log_request(request, response) ⇒ nil
Log info about request.
-
#logger ⇒ Logger
Default logger.
Instance Method Details
#hide_keys(string) ⇒ String
Hide sensitive info
28 29 30 |
# File 'lib/onlyoffice_bugzilla_helper/logger_wrapper.rb', line 28 def hide_keys(string) string&.gsub(@key, '[REMOVED]') end |
#log_request(request, response) ⇒ nil
Log info about request
17 18 19 20 21 22 23 |
# File 'lib/onlyoffice_bugzilla_helper/logger_wrapper.rb', line 17 def log_request(request, response) logger.info('Made request. '\ "Type: #{request.method}. "\ "Path: #{hide_keys(request.path)}. "\ "Body: #{hide_keys(request.body)}. "\ "Response: #{hide_keys(response.body)}") end |
#logger ⇒ Logger
Returns default logger.
9 10 11 |
# File 'lib/onlyoffice_bugzilla_helper/logger_wrapper.rb', line 9 def logger @logger ||= Logger.new($stdout) end |