Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LoggerHolder.php

class LoggerHolder

Hierarchy

  • class \OpenTelemetry\API\LoggerHolder

Expanded class hierarchy of LoggerHolder

1 file declares its use of LoggerHolder
LogWriterFactory.php in vendor/open-telemetry/api/Behavior/Internal/LogWriterFactory.php

File

vendor/open-telemetry/api/LoggerHolder.php, line 10

Namespace

OpenTelemetry\API
View source
final class LoggerHolder {
    private static ?LoggerInterface $logger = null;
    
    /**
     * This constructor is a temporary solution to ease the setup of the logger with DI libraries
     */
    public function __construct(?LoggerInterface $logger = null) {
        self::$logger = $logger;
    }
    
    /**
     * @suppress PhanTypeMismatchReturnNullable
     * @internal
     */
    public static function get() : ?LoggerInterface {
        return self::$logger;
    }
    public static function set(?LoggerInterface $logger) : void {
        self::$logger = $logger;
    }
    public static function isSet() : bool {
        return null !== self::$logger;
    }
    
    /**
     * @internal
     */
    public static function unset() : void {
        self::$logger = null;
    }
    
    /**
     * Disable psr-3 logging
     * @internal
     */
    public static function disable() : void {
        self::$logger = new NullLogger();
    }

}

Members

Title Sort descending Modifiers Object type Summary
LoggerHolder::$logger private static property
LoggerHolder::disable public static function Disable psr-3 logging
@internal
LoggerHolder::get public static function @suppress PhanTypeMismatchReturnNullable
@internal
LoggerHolder::isSet public static function
LoggerHolder::set public static function
LoggerHolder::unset public static function @internal
LoggerHolder::__construct public function This constructor is a temporary solution to ease the setup of the logger with DI libraries
RSS feed
Powered by Drupal