Class: Zapp::Logger

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/zapp/logger.rb,
lib/zapp/logger/base.rb

Overview

The default logger for Zapp

Defined Under Namespace

Modules: Base

Constant Summary collapse

GLOBAL_INSTANCE_KEY =

The hash key in Ractor.current that stores the global Zapp::Logger instance

"ZAPP_LOGGER_INSTANCE"

Constants included from Base

Base::FROZEN_ENV, Base::LEVELS, Base::OUT_IO_MUTEX_KEY

Instance Attribute Summary

Attributes included from Base

#level

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base

#debug, #error, #flush, #info, #log, #out=, #trace, #warn

Constructor Details

#initialize {|_self| ... } ⇒ Logger

Returns a new instance of Logger.

Yields:

  • (_self)

Yield Parameters:

  • _self (Zapp::Logger)

    the object that the method was called on



10
11
12
# File 'lib/zapp/logger.rb', line 10

def initialize
  yield(self) if block_given?
end

Class Method Details

.instanceObject



18
19
20
# File 'lib/zapp/logger.rb', line 18

def instance
  Ractor.current[GLOBAL_INSTANCE_KEY] ||= new
end