comment out debug printing to log file

This commit is contained in:
zebardy 2019-11-17 16:32:48 +00:00
parent 72f60bc321
commit 1659e151a7
3 changed files with 25 additions and 25 deletions

View File

@ -119,9 +119,9 @@ class StockApiController extends BaseApiController
$result = null;
$fp = fopen('/www/data/sql.log', 'a');
fwrite($fp, "???executing api consume product");
$time_start = microtime(true);
#$fp = fopen('/www/data/sql.log', 'a');
#fwrite($fp, "???executing api consume product");
#$time_start = microtime(true);
try
{
@ -166,8 +166,8 @@ class StockApiController extends BaseApiController
{
$result = $this->GenericErrorResponse($response, $ex->getMessage());
}
fwrite($fp, "???API Consume product - Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
fclose($fp);
#fwrite($fp, "???API Consume product - Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
#fclose($fp);
return $result;
}

View File

@ -11,9 +11,9 @@ class StockController extends BaseController
public function __construct(\Slim\Container $container)
{
$fp = fopen('/www/data/sql.log', 'a');
fwrite($fp, "!!!constructing StockController\n");
fclose($fp);
#$fp = fopen('/www/data/sql.log', 'a');
#fwrite($fp, "!!!constructing StockController\n");
#fclose($fp);
parent::__construct($container);
$this->StockService = new StockService();
$this->UserfieldsService = new UserfieldsService();

View File

@ -21,9 +21,9 @@ class PDOWrap
public function __call($name,$pars){
$result = null;
$fp = fopen('/www/data/sql.log', 'a');
fwrite($fp, "PDO::".$name." called with arguments:- ".implode( ", ", $pars)."\n");
$time_start = microtime(true);
#$fp = fopen('/www/data/sql.log', 'a');
#fwrite($fp, "PDO::".$name." called with arguments:- ".implode( ", ", $pars)."\n");
#$time_start = microtime(true);
if(in_array($name, array("exec","query")))
{
fwrite($fp, array_values($pars)[0] . "\n");
@ -31,8 +31,8 @@ class PDOWrap
}else{
$result = call_user_func_array([$this->instance,$name],$pars);
}
fwrite($fp, "Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
fclose($fp);
#fwrite($fp, "Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
#fclose($fp);
return $result;
}
}
@ -77,16 +77,16 @@ class DatabaseService
if (self::$DbConnectionRaw == null)
#if ($this->DbConnectionRaw == null)
{
$fp = fopen('/www/data/sql.log', 'a');
fwrite($fp, "+++Creating new PDO object\n");
$time_start = microtime(true);
#$fp = fopen('/www/data/sql.log', 'a');
#fwrite($fp, "+++Creating new PDO object\n");
#$time_start = microtime(true);
$pdo = new PDOWrap('sqlite:' . $this->GetDbFilePath());
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
self::$DbConnectionRaw = $pdo;
#$this->DbConnectionRaw = $pdo;
fwrite($fp, "+++Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
fwrite($fp, "+++object created\n");
fclose($fp);
#fwrite($fp, "+++Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
#fwrite($fp, "+++object created\n");
#fclose($fp);
}
return self::$DbConnectionRaw;
@ -103,14 +103,14 @@ class DatabaseService
if (self::$DbConnection == null)
#if ($this->DbConnection == null)
{
$fp = fopen('/www/data/sql.log', 'a');
fwrite($fp, "---creating new LessQL::Database object\n");
$time_start = microtime(true);
#$fp = fopen('/www/data/sql.log', 'a');
#fwrite($fp, "---creating new LessQL::Database object\n");
#$time_start = microtime(true);
self::$DbConnection = new \LessQL\Database($this->GetDbConnectionRaw());
#$this->DbConnection = new \LessQL\Database($this->GetDbConnectionRaw());
fwrite($fp, "---Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
fwrite($fp, "---object created\n");
fclose($fp);
#fwrite($fp, "---Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
#fwrite($fp, "---object created\n");
#fclose($fp);
}
return self::$DbConnection;