PluginProbe
WP Super Minify • Minify, Compress and Cache HTML, CSS & JavaScript / trunk
WP Super Minify • Minify, Compress and Cache HTML, CSS & JavaScript vtrunk
trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.4 1.5 1.5.1 1.6 2.0 2.0.1
wp-super-minify / includes / min / lib / Minify / Logger.php

Logger.php in WP Super Minify • Minify, Compress and Cache HTML, CSS & JavaScript trunk, at includes/min/lib/Minify/Logger.php

48 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 * @deprecated 2.3 This will be removed in Minify 3.0
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 }
48