Airship\Engine\Continuum\Log::store PHP Method

store() public method

Store information inside of the Continuum Log
public store ( string $level, string $message, array $context = [] ) : mixed
$level string
$message string
$context array
return mixed
    public function store(string $level, string $message, array $context = [])
    {
        return $this->db->insertGet('airship_continuum_log', ['loglevel' => $level, 'component' => $this->component, 'message' => $message, 'context' => \json_encode($context)], 'logid');
    }

Usage Example

Example #1
0
 /**
  * Somewhat self-explanatory. This just sets the 'installed' column in the
  * database to 'TRUE' so our web UI knows that it's installed.
  *
  * @param InstallFile $install
  * @return bool
  */
 public function markPackageInstalled(InstallFile $install) : bool
 {
     $db = \Airship\get_database();
     $db->beginTransaction();
     $db->update('airship_package_cache', ['installed' => true, 'current_version' => $install->getVersion()], ['packagetype' => $this->type, 'supplier' => $this->supplier->getName(), 'name' => $this->package]);
     self::$continuumLogger->store(LogLevel::DEBUG, 'Package marked as installed', $this->getLogContext($install));
     return $db->commit();
 }