HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //usr/local/lib/php/test/Log/tests/priority.phpt
--TEST--
Log: Priorities
--INI--
date.timezone=UTC
--FILE--
<?php

require_once 'Log.php';

$conf = array('lineFormat' => '[%3$s] %4$s');
$logger = Log::singleton('console', '', 'ident', $conf);

/* Log at the default PEAR_LOG_INFO level. */
$logger->log('Log message');

/* Set the default priority to PEAR_LOG_DEBUG. */
$logger->setPriority(PEAR_LOG_DEBUG);
$logger->log('Log message');

/* Verify that the getPriority() method also things we're at PEAR_LOG_DEBUG. */
$priority = $logger->priorityToString($logger->getPriority());
echo "$priority\n";

/* Verify that stringToPriority() can convert back to a constant. */
$priority = $logger->stringToPriority($priority);
echo "$priority\n";

--EXPECT--
[info] Log message
[debug] Log message
debug
7