text changes to registration mail content
[namibia] / public / min / lib / Minify / Logger.php
1 <?php
2 /**
3  * Class Minify_Logger  
4  * @package Minify
5  */
6
7 /** 
8  * Message logging class
9  * 
10  * @package Minify
11  * @author Stephen Clay <steve@mrclay.org>
12  *
13  * @todo lose this singleton! pass log object in Minify::serve and distribute to others
14  */
15 class Minify_Logger {
16
17     /**
18      * Set logger object. 
19      *
20      * The object should have a method "log" that accepts a value as 1st argument and
21      * an optional string label as the 2nd.
22      *
23      * @param mixed $obj or a "falsey" value to disable
24      * @return null
25      */
26     public static function setLogger($obj = null) {
27         self::$_logger = $obj
28             ? $obj
29             : null;
30     }
31     
32     /**
33      * Pass a message to the logger (if set)
34      *
35      * @param string $msg message to log
36      * @return null
37      */
38     public static function log($msg, $label = 'Minify') {
39         if (! self::$_logger) return;
40         self::$_logger->log($msg, $label);
41     }
42     
43     /**
44      * @var mixed logger object (like FirePHP) or null (i.e. no logger available)
45      */
46     private static $_logger = null;
47 }