From 6a857f6cc1bd857dddd53c0e3475c8661d0fb578 Mon Sep 17 00:00:00 2001 From: PranavK Date: Sun, 4 Jan 2015 12:50:45 +0530 Subject: [PATCH] MWDebug: Add support for passing objects Change-Id: I121acab012676e486e19b3f8b0fae50af3d3a567 --- includes/debug/MWDebug.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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', -- 2.20.1