public function createFormatter($classOrName, $args = [])
    {
        $classes = [
            $classOrName,
            '\\Monolog\\Formatter\\' . $classOrName
        ];

        foreach ($classes as $class)
        {
            if (class_exists($class))
            {
                $object = (new ReflectionClass($class))->newInstanceArgs($args);

                return new Formatter($object);
            }
        }

        throw new InvalidArgumentException("Monolog formatter [$classOrName] does not exist.");
    }
public function createFormatter($classOrName, $args = [])
    {
        $classes = [
            $classOrName,
            '\\Monolog\\Formatter\\' . $classOrName
        ];

        foreach ($classes as $class)
        {
            if (class_exists($class))
            {
                $object = (new ReflectionClass($class))->newInstanceArgs($args);

                return new Formatter($object);
            }
        }

        throw new InvalidArgumentException("Monolog formatter [$classOrName] does not exist.");
    }
public function createFormatter ( $ classOrName , $ args = [ ] ) { $ classes = [ $ classOrName , '\\Monolog\\Formatter\\' . $ classOrName ] ; foreach ( $ classes as $ class ) { if ( class_exists ( $ class ) ) { $ object = ( new ReflectionClass ( $ class ) ) -> newInstanceArgs ( $ args ) ; return new Formatter ( $ object ) ; } } throw new InvalidArgumentException ( "Monolog formatter [$classOrName] does not exist." ) ; }
Create one of Monolog formatters by specyfing it name of full class.

@param string $classOrName
@param mixed[] $args
@return FormatterInterface
@throws InvalidArgumentException
Create one of Monolog formatters by specyfing it name of full class .