Module: OmfCommon::DefaultLogging
- Defined in:
- omf_common/lib/omf_common/default_logging.rb
Instance Method Summary (collapse)
- - (Object) debug(*args, &block)
- - (Object) error(*args, &block)
- - (Object) fatal(*args, &block)
- - (Object) get_logger(name = nil) private
-
- (Object) info(*args, &block)
Alias logging method using default logger.
- - (Object) warn(*args, &block)
-
- (Object) warn_deprecation(deprecated_name, *suggest_names)
Log a warning message for deprecated methods.
- - (Object) warn_removed(deprecated_name)
Instance Method Details
- (Object) debug(*args, &block)
33 34 35 |
# File 'omf_common/lib/omf_common/default_logging.rb', line 33 def debug(*args, &block) get_logger(args[1]).debug(args[0], &block) end |
- (Object) error(*args, &block)
38 39 40 |
# File 'omf_common/lib/omf_common/default_logging.rb', line 38 def error(*args, &block) get_logger(args[1]).error(args[0], &block) end |
- (Object) fatal(*args, &block)
43 44 45 |
# File 'omf_common/lib/omf_common/default_logging.rb', line 43 def fatal(*args, &block) get_logger(args[1]).fatal(args[0], &block) end |
- (Object) get_logger(name = nil) (private)
65 66 67 |
# File 'omf_common/lib/omf_common/default_logging.rb', line 65 def get_logger(name = nil) name.nil? ? logger : Logging::Logger["#{logger.name}::#{name.to_s}"] end |
- (Object) info(*args, &block)
Alias logging method using default logger
28 29 30 |
# File 'omf_common/lib/omf_common/default_logging.rb', line 28 def info(*args, &block) get_logger(args[1]).info(args[0], &block) end |
- (Object) warn(*args, &block)
48 49 50 |
# File 'omf_common/lib/omf_common/default_logging.rb', line 48 def warn(*args, &block) get_logger(args[1]).warn(args[0], &block) end |
- (Object) warn_deprecation(deprecated_name, *suggest_names)
Log a warning message for deprecated methods
53 54 55 |
# File 'omf_common/lib/omf_common/default_logging.rb', line 53 def warn_deprecation(deprecated_name, *suggest_names) logger.warn "[DEPRECATION] '#{deprecated_name}' is deprecated. Please use '#{suggest_names.join(', ')}' instead." end |
- (Object) warn_removed(deprecated_name)
57 58 59 60 61 |
# File 'omf_common/lib/omf_common/default_logging.rb', line 57 def warn_removed(deprecated_name) define_method(deprecated_name) do |*args, &block| logger.warn "[DEPRECATION] '#{deprecated_name}' is deprecated and not supported. Please do not use it." end end |