$context['prefix'] = $wgDebugLogPrefix;
}
- $logger = MWLogger::getInstance( 'wfDebug' );
+ $logger = MWLoggerFactory::getInstance( 'wfDebug' );
$logger->debug( $text, $context );
}
MWDebug::debugMsg( "[{$logGroup}] {$text}\n" );
}
- $logger = MWLogger::getInstance( $logGroup );
+ $logger = MWLoggerFactory::getInstance( $logGroup );
$context['private'] = ( $dest === 'private' );
$logger->info( $text, $context );
}
* @param array $context Additional logging context data
*/
function wfLogDBError( $text, array $context = array() ) {
- $logger = MWLogger::getInstance( 'wfLogDBError' );
+ $logger = MWLoggerFactory::getInstance( 'wfLogDBError' );
$logger->error( trim( $text ), $context );
}
*/
function wfErrorLog( $text, $file, array $context = array() ) {
wfDeprecated( __METHOD__, '1.25' );
- $logger = MWLogger::getInstance( 'wfErrorLog' );
+ $logger = MWLoggerFactory::getInstance( 'wfErrorLog' );
$context['destination'] = $file;
$logger->info( trim( $text ), $context );
}
$ctx['output'] = $profiler->getOutput();
- $log = MWLogger::getInstance( 'profileoutput' );
+ $log = MWLoggerFactory::getInstance( 'profileoutput' );
$log->info( "Elapsed: {elapsed}; URL: <{url}>\n{output}", $ctx );
}
*/
function wfHttpError( $code, $label, $desc ) {
global $wgOut;
- $wgOut->disable();
header( "HTTP/1.0 $code $label" );
header( "Status: $code $label" );
- $wgOut->sendCacheControl();
+ if ( $wgOut ) {
+ $wgOut->disable();
+ $wgOut->sendCacheControl();
+ }
header( 'Content-type: text/html; charset=utf-8' );
print "<!doctype html>" .
* @param string|null $deprecatedVersion Optionally mark hook as deprecated with version number
*
* @return bool True if no handler aborted the hook
- * @deprecated 1.25
+ * @deprecated 1.25 - use Hooks::run
*/
function wfRunHooks( $event, array $args = array(), $deprecatedVersion = null ) {
return Hooks::run( $event, $args, $deprecatedVersion );