Module: Cosmo::Logger

Extended by:
Forwardable
Defined in:
lib/cosmo/logger.rb,
sig/cosmo/logger.rbs

Defined Under Namespace

Modules: Context Classes: BaseFormatter, Instance, SimpleFormatter

Constant Summary collapse

TRACE =

Below DEBUG; opt in with COSMO_LOG_LEVEL=trace for high-frequency polling/loop noise

Returns:

  • (Integer)
-1 # Below DEBUG; opt in with COSMO_LOG_LEVEL=trace for high-frequency polling/loop noise

Class Method Summary collapse

Class Method Details

.debugvoid

This method returns an undefined value.

Parameters:

  • (::String, Exception)


35
# File 'sig/cosmo/logger.rbs', line 35

def self.debug: (::String | Exception) -> void

.errorvoid

This method returns an undefined value.

Parameters:

  • (::String, Exception)


33
# File 'sig/cosmo/logger.rbs', line 33

def self.error: (::String | Exception) -> void

.fatalvoid

This method returns an undefined value.

Parameters:

  • (::String)


39
# File 'sig/cosmo/logger.rbs', line 39

def self.fatal: (::String) -> void

.infovoid

This method returns an undefined value.

Parameters:

  • (::String)


31
# File 'sig/cosmo/logger.rbs', line 31

def self.info: (::String) -> void

.instanceObject

Returns:

  • (Object)


75
76
77
78
79
80
# File 'lib/cosmo/logger.rb', line 75

def self.instance
  @instance ||= Instance.new($stdout).tap do |logger|
    logger.formatter = SimpleFormatter.new
    logger.level = coerce_level(ENV.fetch("COSMO_LOG_LEVEL", "info"))
  end
end

.instance=(logger) ⇒ Object



87
88
89
# File 'lib/cosmo/logger.rb', line 87

def self.instance=(logger)
  @instance = logger
end

.tracevoid

This method returns an undefined value.

Parameters:

  • (::String, Exception)


41
# File 'sig/cosmo/logger.rbs', line 41

def self.trace: (::String | Exception) -> void

.warnvoid

This method returns an undefined value.

Parameters:

  • (::String)


37
# File 'sig/cosmo/logger.rbs', line 37

def self.warn: (::String) -> void

.withvoid

This method returns an undefined value.

Parameters:

  • (Object)


67
68
69
# File 'lib/cosmo/logger.rb', line 67

def self.with(...)
  Context.with(...)
end

.withoutnil

Parameters:

  • (Symbol)

Returns:

  • (nil)


71
72
73
# File 'lib/cosmo/logger.rb', line 71

def self.without(...)
  Context.without(...)
end