Change Logging class / method name and Debug Support for backtrace
Debug Support: getCallerClass now returns level 1 class from the trace like the getCallerMethod. There is also a new getCallerClassMethod that returns namespace\class->method (or :: for static). getCallerTopLevelClass works like getCallerClass did before and returns the TOP level (first entry on the call stack that has a set class name) Logging: Do not use the Support getCallerClass/Method/File but call it inside and use level 2 in trace to get the data we need For the last call before debug call Also update the strack trace for the debug call to use ->/:: for method type
This commit is contained in:
@@ -405,7 +405,7 @@ class LoggingLegacy
|
||||
// set per class, but don't use get_class as we will only get self
|
||||
$rpl_string = !$this->log_per_class ? '' : '_'
|
||||
// set sub class settings
|
||||
. str_replace('\\', '-', Support::getCallerClass());
|
||||
. str_replace('\\', '-', Support::getCallerTopLevelClass());
|
||||
$fn = str_replace('{CLASS}', $rpl_string, $fn); // create output filename
|
||||
|
||||
// if request to write to one file
|
||||
@@ -756,7 +756,7 @@ class LoggingLegacy
|
||||
return $status;
|
||||
}
|
||||
// get the last class entry and wrie that
|
||||
$class = Support::getCallerClass();
|
||||
$class = Support::getCallerTopLevelClass();
|
||||
// get timestamp
|
||||
$timestamp = Support::printTime();
|
||||
// same string put for print (no html data inside)
|
||||
@@ -855,7 +855,7 @@ class LoggingLegacy
|
||||
. 'border-bottom: 1px solid black; margin: 10px 0 10px 0; '
|
||||
. 'background-color: white; color: black;">'
|
||||
. '<div style="font-size: 12px;">{<span style="font-style: italic; color: #928100;">'
|
||||
. Support::getCallerClass() . '</span>}</div>';
|
||||
. Support::getCallerTopLevelClass() . '</span>}</div>';
|
||||
$string_output = $string_prefix . $string_output
|
||||
. '<div><span style="font-style: italic; color: #108db3;">Script Run Time:</span> '
|
||||
. $script_end . '</div>'
|
||||
|
||||
Reference in New Issue
Block a user