Enable logging in FrontEndFileHandler

This commit is contained in:
Kijin Sung 2025-03-27 10:28:13 +09:00
parent f019236976
commit df1c365872

View file

@ -53,6 +53,12 @@ class FrontEndFileHandler extends Handler
*/
public $jsBodyMapIndex = array();
/**
* Logging
*/
protected $_log_enabled = false;
protected $_log_entries = [];
/**
* Check SSL
*
@ -92,6 +98,10 @@ class FrontEndFileHandler extends Handler
{
$args = array($args);
}
if ($this->_log_enabled)
{
$this->_log_entries[] = $args;
}
// Replace obsolete paths with current paths.
$args[0] = preg_replace(array_keys(HTMLDisplayHandler::$replacements), array_values(HTMLDisplayHandler::$replacements), $args[0]);
@ -252,6 +262,26 @@ class FrontEndFileHandler extends Handler
return $file;
}
/**
* Start logging.
*/
public function startLog()
{
$this->_log_enabled = true;
$this->_log_entries = [];
}
/**
* End logging and return the log entries.
*
* @return array
*/
public function endLog(): array
{
$this->_log_enabled = false;
return $this->_log_entries;
}
/**
* Process CSS and JS file
*