From: PranavK Date: Sun, 4 Jan 2015 07:20:45 +0000 (+0530) Subject: MWDebug: Add support for passing objects X-Git-Tag: 1.31.0-rc.0~8238 X-Git-Url: http://git.cyclocoop.org/%22%20%20.%20generer_url_ecrire%28%22mots_tous%22%29%20.%20%22?a=commitdiff_plain;h=6a857f6cc1bd857dddd53c0e3475c8661d0fb578;p=lhc%2Fweb%2Fwiklou.git MWDebug: Add support for passing objects Change-Id: I121acab012676e486e19b3f8b0fae50af3d3a567 --- diff --git a/includes/debug/MWDebug.php b/includes/debug/MWDebug.php index 8f943bf7ba..4faa1dd294 100644 --- a/includes/debug/MWDebug.php +++ b/includes/debug/MWDebug.php @@ -91,16 +91,16 @@ class MWDebug { /** * Adds a line to the log * - * @todo Add support for passing objects - * * @since 1.19 - * @param string $str + * @param mixed $str */ public static function log( $str ) { if ( !self::$enabled ) { return; } - + if ( !is_string( $str ) ) { + $str = print_r( $str, true ); + } self::$log[] = array( 'msg' => htmlspecialchars( $str ), 'type' => 'log',