Class: CustomLogger
- Inherits:
-
Logger
- Object
- Logger
- CustomLogger
- Defined in:
- lib/mangopay/util/custom_logger.rb
Overview
Custom Logger implementation which handles concatenation of multiple provided arguments into the log message string, allowing for much cleaner logging statements.
Direct Known Subclasses
Instance Method Summary collapse
- #debug(message, *args) ⇒ Object
- #error(message, *args) ⇒ Object
- #fatal(message, *args) ⇒ Object
- #format(msg, msg_args) ⇒ Object
- #info(message, *args) ⇒ Object
- #warn(message, *args) ⇒ Object
Instance Method Details
#debug(message, *args) ⇒ Object
8 9 10 |
# File 'lib/mangopay/util/custom_logger.rb', line 8 def debug(, *args) super(format(, args)) end |
#error(message, *args) ⇒ Object
20 21 22 |
# File 'lib/mangopay/util/custom_logger.rb', line 20 def error(, *args) super(format(, args)) end |
#fatal(message, *args) ⇒ Object
24 25 26 |
# File 'lib/mangopay/util/custom_logger.rb', line 24 def fatal(, *args) super(format(, args)) end |
#format(msg, msg_args) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/mangopay/util/custom_logger.rb', line 28 def format(msg, msg_args) msg_args.each do |arg| msg.sub! '{}', arg.to_s end msg end |
#info(message, *args) ⇒ Object
12 13 14 |
# File 'lib/mangopay/util/custom_logger.rb', line 12 def info(, *args) super(format(, args)) end |
#warn(message, *args) ⇒ Object
16 17 18 |
# File 'lib/mangopay/util/custom_logger.rb', line 16 def warn(, *args) super(format(, args)) end |