public function offsetGet($offset)
    {
        if (!is_string($offset)) {
            throw new \Plop\Exception('Invalid identifier');
        }

        $parts = explode(':', $offset, 3);
        if (count($parts) != 3) {
            throw new \Plop\Exception('Invalid identifier');
        }
        list($method, $class, $ns) = $parts;

        $len = -strlen('\\');
        while (substr($ns, $len) == '\\') {
            $ns = (string) substr($ns, 0, $len);
        }

        // Namespace, class and method/function match.
        if (isset($this->loggers["$method:$class:$ns"])) {
            return $this->loggers["$method:$class:$ns"];
        }

        // Namespace and class match.
        if ($class != "" && isset($this->loggers[":$class:$ns"])) {
            return $this->loggers[":$class:$ns"];
        }

        // Namespace match.
        $parts = explode('\\', $ns);
        while (count($parts)) {
            $offset = implode('\\', $parts);
            if ($offset == '') {
                break;
            }

            if (isset($this->loggers["::$offset"])) {
                return $this->loggers["::$offset"];
            }
            array_pop($parts);
        }

        // Root logger.
        return $this->loggers['::'];
    }
public function offsetGet($offset)
    {
        if (!is_string($offset)) {
            throw new \Plop\Exception('Invalid identifier');
        }

        $parts = explode(':', $offset, 3);
        if (count($parts) != 3) {
            throw new \Plop\Exception('Invalid identifier');
        }
        list($method, $class, $ns) = $parts;

        $len = -strlen('\\');
        while (substr($ns, $len) == '\\') {
            $ns = (string) substr($ns, 0, $len);
        }

        // Namespace, class and method/function match.
        if (isset($this->loggers["$method:$class:$ns"])) {
            return $this->loggers["$method:$class:$ns"];
        }

        // Namespace and class match.
        if ($class != "" && isset($this->loggers[":$class:$ns"])) {
            return $this->loggers[":$class:$ns"];
        }

        // Namespace match.
        $parts = explode('\\', $ns);
        while (count($parts)) {
            $offset = implode('\\', $parts);
            if ($offset == '') {
                break;
            }

            if (isset($this->loggers["::$offset"])) {
                return $this->loggers["::$offset"];
            }
            array_pop($parts);
        }

        // Root logger.
        return $this->loggers['::'];
    }
public function offsetGet ( $ offset ) { if ( ! is_string ( $ offset ) ) { throw new \ Plop \ Exception ( 'Invalid identifier' ) ; } $ parts = explode ( ':' , $ offset , 3 ) ; if ( count ( $ parts ) != 3 ) { throw new \ Plop \ Exception ( 'Invalid identifier' ) ; } list ( $ method , $ class , $ ns ) = $ parts ; $ len = - strlen ( '\\' ) ; while ( substr ( $ ns , $ len ) == '\\' ) { $ ns = ( string ) substr ( $ ns , 0 , $ len ) ; } // Namespace, class and method/function match. if ( isset ( $ this -> loggers [ "$method:$class:$ns" ] ) ) { return $ this -> loggers [ "$method:$class:$ns" ] ; } // Namespace and class match. if ( $ class != "" && isset ( $ this -> loggers [ ":$class:$ns" ] ) ) { return $ this -> loggers [ ":$class:$ns" ] ; } // Namespace match. $ parts = explode ( '\\' , $ ns ) ; while ( count ( $ parts ) ) { $ offset = implode ( '\\' , $ parts ) ; if ( $ offset == '' ) { break ; } if ( isset ( $ this -> loggers [ "::$offset" ] ) ) { return $ this -> loggers [ "::$offset" ] ; } array_pop ( $ parts ) ; } // Root logger. return $ this -> loggers [ '::' ] ; }
Return the registered logger with the given identifier,
one of its parents, or the root logger if no other logger
can be found.

\param string $offset
Identifier of the logger to return.

\retval Plop::LoggerInterface
The registered logger with that identifier if one
was found, or the root logger.

\warning
Do not call this method directly or bad things may happen.
Use Plop::getLogger() instead.
Return the registered logger with the given identifier one of its parents or the root logger if no other logger can be found .