Logging
in package
Logging utility functions for internal logging (of OpenTelemetry errors/warnings etc).
This is not part of SDK configuration to avoid creating a dependency on SDK from any package which does logging.
Tags
Table of Contents
Constants
- DEFAULT_LEVEL = \Psr\Log\LogLevel::INFO
- LEVELS = [\Psr\Log\LogLevel::DEBUG, \Psr\Log\LogLevel::INFO, \Psr\Log\LogLevel::NOTICE, \Psr\Log\LogLevel::WARNING, \Psr\Log\LogLevel::ERROR, \Psr\Log\LogLevel::CRITICAL, \Psr\Log\LogLevel::ALERT, \Psr\Log\LogLevel::EMERGENCY, self::NONE]
- NONE = 'none'
- OTEL_LOG_LEVEL = 'OTEL_LOG_LEVEL'
Properties
- $logLevel : int|null
- The minimum log level. Messages with lower severity than this will be ignored.
- $writer : LogWriterInterface|null
Methods
- disable() : void
- level() : int
- Get level priority from level name
- logLevel() : int
- Get defined OTEL_LOG_LEVEL, or default
- logWriter() : LogWriterInterface
- reset() : void
- setLogWriter() : void
- getLogLevel() : int
Constants
DEFAULT_LEVEL
private
mixed
DEFAULT_LEVEL
= \Psr\Log\LogLevel::INFO
LEVELS
private
mixed
LEVELS
= [\Psr\Log\LogLevel::DEBUG, \Psr\Log\LogLevel::INFO, \Psr\Log\LogLevel::NOTICE, \Psr\Log\LogLevel::WARNING, \Psr\Log\LogLevel::ERROR, \Psr\Log\LogLevel::CRITICAL, \Psr\Log\LogLevel::ALERT, \Psr\Log\LogLevel::EMERGENCY, self::NONE]
NONE
private
mixed
NONE
= 'none'
OTEL_LOG_LEVEL
private
mixed
OTEL_LOG_LEVEL
= 'OTEL_LOG_LEVEL'
Properties
$logLevel
The minimum log level. Messages with lower severity than this will be ignored.
private
static int|null
$logLevel
= null
$writer
private
static LogWriterInterface|null
$writer
= null
Methods
disable()
public
static disable() : void
level()
Get level priority from level name
public
static level(string $level) : int
Parameters
- $level : string
Return values
intlogLevel()
Get defined OTEL_LOG_LEVEL, or default
public
static logLevel() : int
Return values
intlogWriter()
public
static logWriter() : LogWriterInterface
Return values
LogWriterInterfacereset()
public
static reset() : void
setLogWriter()
public
static setLogWriter(LogWriterInterface $writer) : void
Parameters
- $writer : LogWriterInterface
getLogLevel()
private
static getLogLevel() : int