Module: AnyCache::Logging::Activity Private

Defined in:
lib/any_cache/logging/activity.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.3.0

Constant Summary collapse

ANONYMOUS_CACHER_CLASS_NAME =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Returns:

  • (String)

Since:

  • 0.3.0

'<__anonymous_cache__>'

Class Method Summary collapse

Class Method Details

.log(cacher, logger, activity: nil, message: nil) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • cacher (AnyCache)
  • logger (::Logger)
  • activity (Hash) (defaults to: nil)

    a customizable set of options

  • message (Hash) (defaults to: nil)

    a customizable set of options

Options Hash (activity:):

  • (String, NilClass)

Options Hash (message:):

  • (String, NillClass)

Since:

  • 0.3.0



21
22
23
24
25
# File 'lib/any_cache/logging/activity.rb', line 21

def log(cacher, logger, activity: nil, message: nil)
  cacher = cacher.class.name || ANONYMOUS_CACHER_CLASS_NAME
  progname = "[AnyCache<#{cacher}>/Activity<#{activity}>]"
  logger.add(logger.level, message, progname)
end