disable auto logging to screen for AJAX-requests
This commit is contained in:
parent
d9d85e2306
commit
0a45d90ba1
3 changed files with 23 additions and 2 deletions
|
@ -37,6 +37,11 @@
|
|||
|
||||
// Add routes
|
||||
$this->addRoutes();
|
||||
|
||||
// Disable screen logging for AJAX requests
|
||||
if($this->request->getParam(0, 'toplevel') == 'ajax') {
|
||||
$this->log->disableAutoLogToScreen();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
*
|
||||
* @var Logger
|
||||
*/
|
||||
private $log;
|
||||
protected $log;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -38,6 +38,13 @@
|
|||
*/
|
||||
const LOGMODE_PHP = 2;
|
||||
|
||||
/**
|
||||
* Do not auto-log to screen
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $autoLogToScreenDisabled = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -76,6 +83,15 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Disable logging to screen when the log mode is automatically
|
||||
* detected.
|
||||
*/
|
||||
public function disableAutoLogToScreen()
|
||||
{
|
||||
$this->autoLogToScreenDisabled = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -108,7 +124,7 @@
|
|||
*/
|
||||
private function getAutoLogMode()
|
||||
{
|
||||
return ($_SERVER['SERVER_ADDR'] == '127.0.0.1') ? self::LOGMODE_SCREEN : self::LOGMODE_PHP;
|
||||
return ($_SERVER['SERVER_ADDR'] == '127.0.0.1' && !$this->autoLogToScreenDisabled) ? self::LOGMODE_SCREEN : self::LOGMODE_PHP;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue