public function log() { $log = KLogger::instance(KLOGGER_PATH . "processors/", KLogger::DEBUG); $log->logInfo("usercoinlog > log > start userId : " . $this->userId . " coin : " . $this->coin . " type : " . $this->type . " add : " . $this->add . " time : " . $this->time . " gameId : " . $this->gameId . " result : " . $this->result . " opponentId : " . $this->opponentId); if (!empty($this->userId)) { $userCoinLog = new GameUserCoinLog(); $userCoinLog->setUserId($this->userId); $userCoinLog->setCoin($this->coin); $userCoinLog->setDifCoin($this->difCoin); $userCoinLog->setTime($this->time); $userCoinLog->setType($this->type); $userCoinLog->setAdd($this->add); $userCoinLog->setGameId($this->gameId); $userCoinLog->setResult($this->result); $userCoinLog->setOpponentId($this->opponentId); try { $user = GameUsers::getGameUserById($this->userId); if (!empty($user)) { $userCoinLog->setUserLevel($user->userLevelNumber); //$userCoinLog->setUserSpentCoin($user->opponentId); } } catch (Exception $exc) { $log->logError("usercoinlog > log > User Error : " . $exc->getTraceAsString()); } try { $userCoinLog->insertIntoDatabase(DBUtils::getConnection()); $log->logInfo("usercoinlog > log > Success"); } catch (Exception $exc) { $log->logError("usercoinlog > log > Error : " . $exc->getTraceAsString()); } } else { $log->logError("usercoinlog > log > user Id is empty "); } }