-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.php
executable file
·46 lines (42 loc) · 1.12 KB
/
logger.php
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* File containing the debugLogger class.
*
* @package
* @version //autogentag//
* @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
* @license http://ez.no/licenses/new_bsd New BSD License
*/
/**
* The debugLogger class is a wrapper around the ezcDebug system.
* It will be called from places in the code where debug is needed,
* but debug will be actually written only when the development mode
* is enabled in ezcBase.
*/
class extendeddebugLogger
{
/**
* Decorated debug handler.
* @var ezcDebug
*/
private static $ezcDebugInstance = null;
public static function __callstatic( $name, $args )
{
if ( ezcBase::getRunMode() == ezcBase::MODE_DEVELOPMENT )
{
return call_user_func_array( array( self::$ezcDebugInstance, $name ), $args );
}
else
return null;
}
/**
* Stores an instance of ezcDebug as class member.
*
* @param ezcDebug $handler instance of ezcDebug
*/
public static function setHandler( ezcDebug $handler )
{
self::$ezcDebugInstance = $handler;
}
}
?>