MediaWiki  master
MWDebug.php
Go to the documentation of this file.
1 <?php
24 
33 class MWDebug {
39  protected static $log = [];
40 
46  protected static $debug = [];
47 
53  protected static $query = [];
54 
60  protected static $enabled = false;
61 
68  protected static $deprecationWarnings = [];
69 
73  protected static $deprecationFilters = [];
74 
78  public static function setup() {
79  global $wgDebugToolbar,
81 
82  if (
83  // Easy to forget to falsify $wgDebugToolbar for static caches.
84  // If file cache or CDN cache is on, just disable this (DWIMD).
85  $wgUseCdn ||
87  // Keep MWDebug off on CLI. This prevents MWDebug from eating up
88  // all the memory for logging SQL queries in maintenance scripts.
90  ) {
91  return;
92  }
93 
94  if ( $wgDebugToolbar ) {
95  self::init();
96  }
97  }
98 
105  public static function init() {
106  self::$enabled = true;
107  }
108 
114  public static function deinit() {
115  self::$enabled = false;
116  }
117 
125  public static function addModules( OutputPage $out ) {
126  if ( self::$enabled ) {
127  $out->addModules( 'mediawiki.debug' );
128  }
129  }
130 
137  public static function log( $str ) {
138  if ( !self::$enabled ) {
139  return;
140  }
141  if ( !is_string( $str ) ) {
142  $str = print_r( $str, true );
143  }
144  self::$log[] = [
145  'msg' => htmlspecialchars( $str ),
146  'type' => 'log',
147  'caller' => wfGetCaller(),
148  ];
149  }
150 
156  public static function getLog() {
157  return self::$log;
158  }
159 
164  public static function clearLog() {
165  self::$log = [];
166  self::$deprecationWarnings = [];
167  }
168 
180  public static function warning( $msg, $callerOffset = 1, $level = E_USER_NOTICE, $log = 'auto' ) {
181  global $wgDevelopmentWarnings;
182 
183  if ( $log === 'auto' && !$wgDevelopmentWarnings ) {
184  $log = 'debug';
185  }
186 
187  if ( $log === 'debug' ) {
188  $level = false;
189  }
190 
191  $callerDescription = self::getCallerDescription( $callerOffset );
192 
194  self::formatCallerDescription( $msg, $callerDescription ),
195  'warning',
196  $level );
197 
198  if ( self::$enabled ) {
199  self::$log[] = [
200  'msg' => htmlspecialchars( $msg ),
201  'type' => 'warn',
202  'caller' => $callerDescription['func'],
203  ];
204  }
205  }
206 
221  public static function deprecated( $function, $version = false,
222  $component = false, $callerOffset = 2
223  ) {
224  if ( $version ) {
225  $component = $component ?: 'MediaWiki';
226  $msg = "Use of $function was deprecated in $component $version.";
227  } else {
228  $msg = "Use of $function is deprecated.";
229  }
230  self::deprecatedMsg( $msg, $version, $component, $callerOffset + 1 );
231  }
232 
254  public static function detectDeprecatedOverride( $instance, $class, $method, $version = false,
255  $component = false, $callerOffset = 2
256  ) {
257  $reflectionMethod = new ReflectionMethod( $instance, $method );
258  $declaringClass = $reflectionMethod->getDeclaringClass()->getName();
259 
260  if ( $declaringClass === $class ) {
261  // not overridden, nothing to do
262  return false;
263  }
264 
265  if ( $version ) {
266  $component = $component ?: 'MediaWiki';
267  $msg = "$declaringClass overrides $method which was deprecated in $component $version.";
268  } else {
269  $msg = "$declaringClass overrides $method which is deprecated.";
270  }
271  self::deprecatedMsg( $msg, $version, $component, $callerOffset + 1 );
272 
273  return true;
274  }
275 
304  public static function deprecatedMsg( $msg, $version = false,
305  $component = false, $callerOffset = 2
306  ) {
307  if ( $callerOffset === false ) {
308  $callerFunc = '';
309  $rawMsg = $msg;
310  } else {
311  $callerDescription = self::getCallerDescription( $callerOffset );
312  $callerFunc = $callerDescription['func'];
313  $rawMsg = self::formatCallerDescription( $msg, $callerDescription );
314  }
315 
316  $sendToLog = true;
317 
318  // Check to see if there already was a warning about this function
319  if ( isset( self::$deprecationWarnings[$msg][$callerFunc] ) ) {
320  return;
321  } elseif ( isset( self::$deprecationWarnings[$msg] ) ) {
322  if ( self::$enabled ) {
323  $sendToLog = false;
324  } else {
325  return;
326  }
327  }
328 
329  self::$deprecationWarnings[$msg][$callerFunc] = true;
330 
331  if ( $version ) {
333 
334  $component = $component ?: 'MediaWiki';
335  if ( $wgDeprecationReleaseLimit && $component === 'MediaWiki' ) {
336  # Strip -* off the end of $version so that branches can use the
337  # format #.##-branchname to avoid issues if the branch is merged into
338  # a version of MediaWiki later than what it was branched from
339  $comparableVersion = preg_replace( '/-.*$/', '', $version );
340 
341  # If the comparableVersion is larger than our release limit then
342  # skip the warning message for the deprecation
343  if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
344  $sendToLog = false;
345  }
346  }
347  }
348 
350  $rawMsg,
351  $sendToLog,
352  $callerFunc
353  );
354  }
355 
368  public static function sendRawDeprecated( $msg, $sendToLog = true, $callerFunc = '' ) {
369  foreach ( self::$deprecationFilters as $filter ) {
370  if ( preg_match( $filter, $msg ) ) {
371  return;
372  }
373  }
374 
375  if ( $sendToLog ) {
376  trigger_error( $msg, E_USER_DEPRECATED );
377  }
378 
379  if ( self::$enabled ) {
380  $logMsg = htmlspecialchars( $msg ) .
381  Html::rawElement( 'div', [ 'class' => 'mw-debug-backtrace' ],
382  Html::element( 'span', [], 'Backtrace:' ) . wfBacktrace()
383  );
384 
385  self::$log[] = [
386  'msg' => $logMsg,
387  'type' => 'deprecated',
388  'caller' => $callerFunc,
389  ];
390  }
391  }
392 
399  public static function filterDeprecationForTest( $regex ) {
400  if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
401  throw new RuntimeException( __METHOD__ . ' can only be used in tests' );
402  }
403  self::$deprecationFilters[] = $regex;
404  }
405 
409  public static function clearDeprecationFilters() {
410  self::$deprecationFilters = [];
411  }
412 
420  private static function getCallerDescription( $callerOffset ) {
421  $callers = wfDebugBacktrace();
422 
423  if ( isset( $callers[$callerOffset] ) ) {
424  $callerfile = $callers[$callerOffset];
425  if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
426  $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
427  } else {
428  $file = '(internal function)';
429  }
430  } else {
431  $file = '(unknown location)';
432  }
433 
434  if ( isset( $callers[$callerOffset + 1] ) ) {
435  $callerfunc = $callers[$callerOffset + 1];
436  $func = '';
437  if ( isset( $callerfunc['class'] ) ) {
438  $func .= $callerfunc['class'] . '::';
439  }
440  if ( isset( $callerfunc['function'] ) ) {
441  $func .= $callerfunc['function'];
442  }
443  } else {
444  $func = 'unknown';
445  }
446 
447  return [ 'file' => $file, 'func' => $func ];
448  }
449 
457  private static function formatCallerDescription( $msg, $caller ) {
458  // When changing this, update the below parseCallerDescription() method as well.
459  return $msg . ' [Called from ' . $caller['func'] . ' in ' . $caller['file'] . ']';
460  }
461 
474  public static function parseCallerDescription( $msg ) {
475  $match = null;
476  preg_match( '/(.*) \[Called from ([^ ]+) in ([^ ]+) at line (\d+)\]$/', $msg, $match );
477  if ( $match ) {
478  return [
479  'message' => "{$match[1]} [Called from {$match[2]}]",
480  'func' => $match[2],
481  'file' => $match[3],
482  'line' => $match[4],
483  ];
484  } else {
485  return null;
486  }
487  }
488 
497  private static function sendMessage( $msg, $group, $level ) {
498  if ( $level !== false ) {
499  trigger_error( $msg, $level );
500  }
501 
502  wfDebugLog( $group, $msg );
503  }
504 
513  public static function debugMsg( $str, $context = [] ) {
515 
516  if ( self::$enabled || $wgDebugComments || $wgShowDebug ) {
517  if ( $context ) {
518  $prefix = '';
519  if ( isset( $context['prefix'] ) ) {
520  $prefix = $context['prefix'];
521  } elseif ( isset( $context['channel'] ) && $context['channel'] !== 'wfDebug' ) {
522  $prefix = "[{$context['channel']}] ";
523  }
524  if ( isset( $context['seconds_elapsed'] ) && isset( $context['memory_used'] ) ) {
525  $prefix .= "{$context['seconds_elapsed']} {$context['memory_used']} ";
526  }
527  $str = LegacyLogger::interpolate( $str, $context );
528  $str = $prefix . $str;
529  }
530  self::$debug[] = rtrim( UtfNormal\Validator::cleanUp( $str ) );
531  }
532  }
533 
544  public static function query( $sql, $function, $runTime, $dbhost ) {
545  if ( !self::$enabled ) {
546  return false;
547  }
548 
549  // Replace invalid UTF-8 chars with a square UTF-8 character
550  // This prevents json_encode from erroring out due to binary SQL data
551  $sql = preg_replace(
552  '/(
553  [\xC0-\xC1] # Invalid UTF-8 Bytes
554  | [\xF5-\xFF] # Invalid UTF-8 Bytes
555  | \xE0[\x80-\x9F] # Overlong encoding of prior code point
556  | \xF0[\x80-\x8F] # Overlong encoding of prior code point
557  | [\xC2-\xDF](?![\x80-\xBF]) # Invalid UTF-8 Sequence Start
558  | [\xE0-\xEF](?![\x80-\xBF]{2}) # Invalid UTF-8 Sequence Start
559  | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start
560  | (?<=[\x0-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle
561  | (?<![\xC2-\xDF]|[\xE0-\xEF]|[\xE0-\xEF][\x80-\xBF]|[\xF0-\xF4]
562  | [\xF0-\xF4][\x80-\xBF]|[\xF0-\xF4][\x80-\xBF]{2})[\x80-\xBF] # Overlong Sequence
563  | (?<=[\xE0-\xEF])[\x80-\xBF](?![\x80-\xBF]) # Short 3 byte sequence
564  | (?<=[\xF0-\xF4])[\x80-\xBF](?![\x80-\xBF]{2}) # Short 4 byte sequence
565  | (?<=[\xF0-\xF4][\x80-\xBF])[\x80-\xBF](?![\x80-\xBF]) # Short 4 byte sequence (2)
566  )/x',
567  '■',
568  $sql
569  );
570 
571  // last check for invalid utf8
572  $sql = UtfNormal\Validator::cleanUp( $sql );
573 
574  self::$query[] = [
575  'sql' => "$dbhost: $sql",
576  'function' => $function,
577  'time' => $runTime,
578  ];
579 
580  return true;
581  }
582 
589  protected static function getFilesIncluded( IContextSource $context ) {
590  $files = get_included_files();
591  $fileList = [];
592  foreach ( $files as $file ) {
593  $size = filesize( $file );
594  $fileList[] = [
595  'name' => $file,
596  'size' => $context->getLanguage()->formatSize( $size ),
597  ];
598  }
599 
600  return $fileList;
601  }
602 
610  public static function getDebugHTML( IContextSource $context ) {
611  global $wgDebugComments;
612 
613  $html = '';
614 
615  if ( self::$enabled ) {
616  self::log( 'MWDebug output complete' );
617  $debugInfo = self::getDebugInfo( $context );
618 
619  // Cannot use OutputPage::addJsConfigVars because those are already outputted
620  // by the time this method is called.
622  ResourceLoader::makeConfigSetScript( [ 'debugInfo' => $debugInfo ] ),
623  $context->getOutput()->getCSP()->getNonce()
624  );
625  }
626 
627  if ( $wgDebugComments ) {
628  $html .= "<!-- Debug output:\n" .
629  htmlspecialchars( implode( "\n", self::$debug ), ENT_NOQUOTES ) .
630  "\n\n-->";
631  }
632 
633  return $html;
634  }
635 
644  public static function getHTMLDebugLog() {
645  global $wgShowDebug;
646 
647  if ( !$wgShowDebug ) {
648  return '';
649  }
650 
651  $ret = "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">\n";
652 
653  foreach ( self::$debug as $line ) {
654  $display = nl2br( htmlspecialchars( trim( $line ) ) );
655 
656  $ret .= "<li><code>$display</code></li>\n";
657  }
658 
659  $ret .= '</ul>' . "\n";
660 
661  return Html::rawElement( 'div', [ 'id' => 'mw-html-debug-log' ], $ret );
662  }
663 
670  public static function appendDebugInfoToApiResult( IContextSource $context, ApiResult $result ) {
671  if ( !self::$enabled ) {
672  return;
673  }
674 
675  // output errors as debug info, when display_errors is on
676  // this is necessary for all non html output of the api, because that clears all errors first
677  $obContents = ob_get_contents();
678  if ( $obContents ) {
679  $obContentArray = explode( '<br />', $obContents );
680  foreach ( $obContentArray as $obContent ) {
681  if ( trim( $obContent ) ) {
682  self::debugMsg( Sanitizer::stripAllTags( $obContent ) );
683  }
684  }
685  }
686 
687  self::log( 'MWDebug output complete' );
688  $debugInfo = self::getDebugInfo( $context );
689 
690  ApiResult::setIndexedTagName( $debugInfo, 'debuginfo' );
691  ApiResult::setIndexedTagName( $debugInfo['log'], 'line' );
692  ApiResult::setIndexedTagName( $debugInfo['debugLog'], 'msg' );
693  ApiResult::setIndexedTagName( $debugInfo['queries'], 'query' );
694  ApiResult::setIndexedTagName( $debugInfo['includes'], 'queries' );
695  $result->addValue( null, 'debuginfo', $debugInfo );
696  }
697 
704  public static function getDebugInfo( IContextSource $context ) {
705  if ( !self::$enabled ) {
706  return [];
707  }
708 
709  $request = $context->getRequest();
710 
711  $branch = GitInfo::currentBranch();
712  if ( GitInfo::isSHA1( $branch ) ) {
713  // If it's a detached HEAD, the SHA1 will already be
714  // included in the MW version, so don't show it.
715  $branch = false;
716  }
717 
718  return [
719  'mwVersion' => MW_VERSION,
720  'phpEngine' => 'PHP',
721  'phpVersion' => PHP_VERSION,
722  'gitRevision' => GitInfo::headSHA1(),
723  'gitBranch' => $branch,
724  'gitViewUrl' => GitInfo::headViewUrl(),
725  'time' => $request->getElapsedTime(),
726  'log' => self::$log,
727  'debugLog' => self::$debug,
728  'queries' => self::$query,
729  'request' => [
730  'method' => $request->getMethod(),
731  'url' => $request->getRequestURL(),
732  'headers' => $request->getAllHeaders(),
733  'params' => $request->getValues(),
734  ],
735  'memory' => $context->getLanguage()->formatSize( memory_get_usage() ),
736  'memoryPeak' => $context->getLanguage()->formatSize( memory_get_peak_usage() ),
737  'includes' => self::getFilesIncluded( $context ),
738  ];
739  }
740 }
MWDebug\query
static query( $sql, $function, $runTime, $dbhost)
Begins profiling on a database query.
Definition: MWDebug.php:544
$wgUseCdn
$wgUseCdn
Enable/disable CDN.
Definition: DefaultSettings.php:3232
MWDebug\getDebugHTML
static getDebugHTML(IContextSource $context)
Returns the HTML to add to the page for the toolbar.
Definition: MWDebug.php:610
ResourceLoader\makeConfigSetScript
static makeConfigSetScript(array $configuration)
Return JS code which will set the MediaWiki configuration array to the given value.
Definition: ResourceLoader.php:1669
Sanitizer\stripAllTags
static stripAllTags( $html)
Take a fragment of (potentially invalid) HTML and return a version with any tags removed,...
Definition: Sanitizer.php:1576
MWDebug
New debugger system that outputs a toolbar on page view.
Definition: MWDebug.php:33
GitInfo\isSHA1
static isSHA1( $str)
Check if a string looks like a hex encoded SHA1 hash.
Definition: GitInfo.php:165
wfDebugBacktrace
wfDebugBacktrace( $limit=0)
Safety wrapper for debug_backtrace().
Definition: GlobalFunctions.php:1294
ResourceLoader\makeInlineScript
static makeInlineScript( $script, $nonce=null)
Make an HTML script that runs given JS code after startup and base modules.
Definition: ResourceLoader.php:1642
MW_VERSION
const MW_VERSION
The running version of MediaWiki.
Definition: Defines.php:36
$wgDeprecationReleaseLimit
$wgDeprecationReleaseLimit
Release limitation to wfDeprecated warnings, if set to a release number development warnings will not...
Definition: DefaultSettings.php:7469
GitInfo\headSHA1
static headSHA1()
Definition: GitInfo.php:402
MWDebug\sendMessage
static sendMessage( $msg, $group, $level)
Send a message to the debug log and optionally also trigger a PHP error, depending on the $level argu...
Definition: MWDebug.php:497
MWDebug\getHTMLDebugLog
static getHTMLDebugLog()
Generate debug log in HTML for displaying at the bottom of the main content area.
Definition: MWDebug.php:644
MWDebug\$debug
static array $debug
Debug messages from wfDebug().
Definition: MWDebug.php:46
MWDebug\getCallerDescription
static getCallerDescription( $callerOffset)
Get an array describing the calling function at a specified offset.
Definition: MWDebug.php:420
$file
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
Definition: router.php:42
GitInfo\headViewUrl
static headViewUrl()
Definition: GitInfo.php:418
MWDebug\getLog
static getLog()
Returns internal log array.
Definition: MWDebug.php:156
wfDebugLog
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
Definition: GlobalFunctions.php:958
$debug
$debug
Definition: mcc.php:31
$wgShowDebug
$wgShowDebug
Display debug data at the bottom of the main content area.
Definition: DefaultSettings.php:7420
MWDebug\getFilesIncluded
static getFilesIncluded(IContextSource $context)
Returns a list of files included, along with their size.
Definition: MWDebug.php:589
ApiResult
This class represents the result of the API operations.
Definition: ApiResult.php:35
$wgUseFileCache
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites.
Definition: DefaultSettings.php:3119
$wgCommandLineMode
global $wgCommandLineMode
Definition: DevelopmentSettings.php:29
MWDebug\debugMsg
static debugMsg( $str, $context=[])
This is a method to pass messages from wfDebug to the pretty debugger.
Definition: MWDebug.php:513
MWDebug\clearDeprecationFilters
static clearDeprecationFilters()
Clear all deprecation filters.
Definition: MWDebug.php:409
MWDebug\$deprecationWarnings
static array $deprecationWarnings
Array of functions that have already been warned, formatted function-caller to prevent a buttload of ...
Definition: MWDebug.php:68
MWDebug\getDebugInfo
static getDebugInfo(IContextSource $context)
Returns the HTML to add to the page for the toolbar.
Definition: MWDebug.php:704
OutputPage\addModules
addModules( $modules)
Load one or more ResourceLoader modules on this page.
Definition: OutputPage.php:562
MWDebug\clearLog
static clearLog()
Clears internal log array and deprecation tracking.
Definition: MWDebug.php:164
MWDebug\deprecated
static deprecated( $function, $version=false, $component=false, $callerOffset=2)
Show a warning that $function is deprecated.
Definition: MWDebug.php:221
MWDebug\setup
static setup()
Definition: MWDebug.php:78
OutputPage
This is one of the Core classes and should be read at least once by any new developers.
Definition: OutputPage.php:50
ApiResult\addValue
addValue( $path, $name, $value, $flags=0)
Add value to the output data at the given path.
Definition: ApiResult.php:397
MWDebug\log
static log( $str)
Adds a line to the log.
Definition: MWDebug.php:137
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:607
MWDebug\appendDebugInfoToApiResult
static appendDebugInfoToApiResult(IContextSource $context, ApiResult $result)
Append the debug info to given ApiResult.
Definition: MWDebug.php:670
$line
$line
Definition: mcc.php:119
$wgDevelopmentWarnings
$wgDevelopmentWarnings
If set to true MediaWiki will throw notices for some possible error conditions and for deprecated fun...
Definition: DefaultSettings.php:7462
GitInfo\currentBranch
static currentBranch()
Definition: GitInfo.php:410
MWDebug\init
static init()
Enabled the debugger and load resource module.
Definition: MWDebug.php:105
MWDebug\deinit
static deinit()
Disable the debugger.
Definition: MWDebug.php:114
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition: IContextSource.php:58
MWDebug\detectDeprecatedOverride
static detectDeprecatedOverride( $instance, $class, $method, $version=false, $component=false, $callerOffset=2)
Show a warning if $method declared in $class is overridden in $instance.
Definition: MWDebug.php:254
MWDebug\filterDeprecationForTest
static filterDeprecationForTest( $regex)
Deprecation messages matching the supplied regex will be suppressed.
Definition: MWDebug.php:399
$wgDebugComments
$wgDebugComments
Send debug data to an HTML comment in the output.
Definition: DefaultSettings.php:7289
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:212
wfBacktrace
wfBacktrace( $raw=null)
Get a debug backtrace as a string.
Definition: GlobalFunctions.php:1322
MWDebug\addModules
static addModules(OutputPage $out)
Add ResourceLoader modules to the OutputPage object if debugging is enabled.
Definition: MWDebug.php:125
MWDebug\$deprecationFilters
static string[] $deprecationFilters
Deprecation filter regexes.
Definition: MWDebug.php:73
IContextSource\getRequest
getRequest()
MWDebug\formatCallerDescription
static formatCallerDescription( $msg, $caller)
Append a caller description to an error message.
Definition: MWDebug.php:457
MediaWiki\Logger\LegacyLogger
PSR-3 logger that mimics the historic implementation of MediaWiki's former wfErrorLog logging impleme...
Definition: LegacyLogger.php:51
Html\element
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:234
MWDebug\warning
static warning( $msg, $callerOffset=1, $level=E_USER_NOTICE, $log='auto')
Adds a warning entry to the log.
Definition: MWDebug.php:180
$wgDebugToolbar
$wgDebugToolbar
Display the new debugging toolbar.
Definition: DefaultSettings.php:7595
MWDebug\parseCallerDescription
static parseCallerDescription( $msg)
Append a caller description to an error message.
Definition: MWDebug.php:474
IContextSource\getOutput
getOutput()
MWDebug\$query
static array $query
SQL statements of the database queries.
Definition: MWDebug.php:53
wfGetCaller
wfGetCaller( $level=2)
Get the name of the function which called this function wfGetCaller( 1 ) is the function with the wfG...
Definition: GlobalFunctions.php:1359
MWDebug\sendRawDeprecated
static sendRawDeprecated( $msg, $sendToLog=true, $callerFunc='')
Send a raw deprecation message to the log and the debug toolbar, without filtering of duplicate messa...
Definition: MWDebug.php:368
MWDebug\deprecatedMsg
static deprecatedMsg( $msg, $version=false, $component=false, $callerOffset=2)
Log a deprecation warning with arbitrary message text.
Definition: MWDebug.php:304
IContextSource\getLanguage
getLanguage()
MWDebug\$log
static array $log
Log lines.
Definition: MWDebug.php:39
MWDebug\$enabled
static bool $enabled
Is the debugger enabled?
Definition: MWDebug.php:60