File: composite.phpt

package info (click to toggle)
php-log 1.10.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 404 kB
  • ctags: 592
  • sloc: php: 1,822; xml: 237; sql: 8; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 810 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Log: Composite Handler
--FILE--
<?php

require_once 'Log.php';

$conf = array('lineFormat' => '%2$s [%3$s] %4$s');
$console1 = &Log::singleton('console', '', 'CONSOLE1', $conf);
$console2 = &Log::singleton('console', '', 'CONSOLE2', $conf);

$composite = &Log::singleton('composite');
$composite->addChild($console1);
$composite->addChild($console2);

$composite->log('This event will be logged to both handlers.');

$composite->setIdent('IDENT');
echo $composite->getIdent() . "\n";

$composite->log('This event will be logged to both handlers.');

--EXPECT--
CONSOLE1 [info] This event will be logged to both handlers.
CONSOLE2 [info] This event will be logged to both handlers.
IDENT
IDENT [info] This event will be logged to both handlers.
IDENT [info] This event will be logged to both handlers.