%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/vendor/quickbooks/v3-php-sdk/src/Diagnostics/ |
Upload File : |
<?php
namespace QuickBooksOnline\API\Diagnostics;
/**
* This file contains Trace Logger.
*/
class TraceLogger extends LoggerBase
{
/**
* Provides a multilevel switch to control tracing.
* @var int $traceSwitch
*/
private $traceSwitchLevel;
/**
* Initializes a new instance of the TraceLogger class.
*/
public function __construct()
{
// Searches for the switch name "IPPTraceSwitch" in the config file of the client.
// If not found then default trace switch is OFF.
$this->traceSwitchLevel = TraceLevel::Off;
}
/**
* Logs messages depending on the ids trace level.
*
* @param TraceLevel $idsTraceLevel IDS Trace Level
* @param string messageToWrite The message to write.
*/
public function Log($idsTraceLevel, $messageToWrite)
{
if ((int)$this->traceSwitchLevel < (int)$idsTraceLevel) {
return;
}
$backTrace = debug_backtrace();
$callerFileName = $backTrace[0]['file'];
$callerFileLineNumber = $backTrace[0]['line'];
$callerFunctionName = $backTrace[0]['function'];
$logMessage = implode(" - ", array(date('Y-m-d H:i:s'),
$callerFileName,
$callerFileLineNumber,
$callerFunctionName,
$messageToWrite));
parent::Log($idsTraceLevel, $logMessage);
}
}