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
55 lines
809 B
PHP
55 lines
809 B
PHP
<?php
|
|
|
|
/*
|
|
* TEST sets for DB::IO
|
|
*/
|
|
|
|
namespace TestCalls\DB;
|
|
|
|
class TestDB
|
|
{
|
|
/** @var \CoreLibs\DB\IO */
|
|
private \CoreLibs\DB\IO $db;
|
|
/** @var \CoreLibs\Logging\Logging */
|
|
private \CoreLibs\Logging\Logging $log;
|
|
|
|
/** @var \TestCalls\Test */
|
|
public $main;
|
|
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @param \TestCalls\Test $main
|
|
*/
|
|
public function __construct(
|
|
\TestCalls\Test $main
|
|
) {
|
|
$this->db = $main->db;
|
|
$this->log = $main->log;
|
|
}
|
|
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @return void
|
|
*/
|
|
private function testDBa(): void
|
|
{
|
|
$this->log->debug('TEST DB', 'Call in testDBa');
|
|
$this->db->dbInfo();
|
|
}
|
|
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testRunDB(): void
|
|
{
|
|
$this->log->debug('TEST DB', 'Call in testRunDB');
|
|
$this->testDBa();
|
|
}
|
|
}
|
|
|
|
// __ENB__
|