Ejemplo n.º 1
0
 public static function add($logName, $short, $full = null)
 {
     $log = Log::createIfNotExists($logName);
     if (!$log->enable_logging->getValue()) {
         return null;
     }
     if (empty($full)) {
         $full = $short;
     }
     if ($short instanceof \Exception) {
         $short = $short->getMessage();
     }
     if ($full instanceof \Exception) {
         $full = (string) $full;
     }
     //
     $result = new Record();
     $result->setLog($log);
     self::fillUserInfo($result);
     $result->short->setValue($short);
     $result->full->setValue($full);
     //
     $result->insert();
     return $result;
 }