Module: Sinlog::ShortRefin

Defined in:
lib/sinlog/06_loggable.rb

Overview

Provids convenient logging methods.

Similar to Refin, but methods omit the log_ prefix.

For example:

  • "msg".err instead of "msg".log_err;
  • "msg".warn instead of "msg".log_warn

Source

refine ::Object { import_methods LogShortExt }

Methods

  • #dbg – DEBUG
  • #info – INFO
  • #warn – WARN
  • #err – ERROR
  • #fatal – FATAL
  • #unk – UNKNOWN

Examples:


require 'sinlog'

module A
  module_function
  using Sinlog::ShortRefin

  def demo = "Something happened".warn
  def respon_to_dbg? = [].respond_to? :dbg
end

A.demo
  # => [WARN] 11:17:38.024 Something happened
  # // (WARN is displayed in yellow highlight; 11:17:38.024 is the current time and may vary)

A.respon_to_dbg?  # => true
[].respond_to? :dbg #=> false

See Also: