当前位置: 首页>>代码示例>>PHP>>正文


PHP Logger::error方法代码示例

本文整理汇总了PHP中Logger::error方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::error方法的具体用法?PHP Logger::error怎么用?PHP Logger::error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Logger的用法示例。


在下文中一共展示了Logger::error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPushDetails

 /**
  *
  * Behaviour extracted from official email hook prep_for_email() function
  *
  * @param GitRepository $repository
  * @param PFUser $user
  * @param type $oldrev
  * @param type $newrev
  * @param type $refname
  * @return Git_Hook_PushDetails
  */
 public function getPushDetails(GitRepository $repository, PFUser $user, $oldrev, $newrev, $refname)
 {
     $change_type = Git_Hook_PushDetails::ACTION_ERROR;
     $revision_list = array();
     $rev_type = '';
     try {
         if ($oldrev == self::FAKE_EMPTY_COMMIT) {
             $revision_list = $this->exec_repo->revListSinceStart($refname, $newrev);
             $change_type = Git_Hook_PushDetails::ACTION_CREATE;
         } elseif ($newrev == self::FAKE_EMPTY_COMMIT) {
             $change_type = Git_Hook_PushDetails::ACTION_DELETE;
         } else {
             $revision_list = $this->exec_repo->revList($oldrev, $newrev);
             $change_type = Git_Hook_PushDetails::ACTION_UPDATE;
         }
         if ($change_type == Git_Hook_PushDetails::ACTION_DELETE) {
             $rev_type = $this->exec_repo->getObjectType($oldrev);
         } else {
             $rev_type = $this->exec_repo->getObjectType($newrev);
         }
     } catch (Git_Command_Exception $exception) {
         $this->logger->error(__CLASS__ . " {$repository->getFullName()} {$refname} {$oldrev} {$newrev} " . $exception->getMessage());
     }
     return new Git_Hook_PushDetails($repository, $user, $refname, $change_type, $rev_type, $revision_list);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:36,代码来源:LogAnalyzer.class.php

示例2: requestPage

 /**
  * Request the page from IMDb
  * @param $url
  * @return string Page html. Empty string on failure
  * @throws Exception\Http
  */
 protected function requestPage($url)
 {
     $this->logger->info("[Page] Requesting [{$url}]");
     $req = $this->buildRequest($url);
     if (!$req->sendRequest()) {
         $this->logger->error("[Page] Failed to connect to server when requesting url [{$url}]");
         if ($this->config->throwHttpExceptions) {
             throw new Exception\Http("Failed to connect to server when requesting url [{$url}]");
         } else {
             return '';
         }
     }
     if (200 == $req->getStatus()) {
         return $req->getResponseBody();
     } elseif ($redirectUrl = $req->getRedirect()) {
         $this->logger->debug("[Page] Following redirect from [{$url}] to [{$redirectUrl}]");
         return $this->requestPage($redirectUrl);
     } else {
         $this->logger->error("[Page] Failed to retrieve url [{url}]. Response headers:{headers}", array('url' => $url, 'headers' => $req->getLastResponseHeaders()));
         if ($this->config->throwHttpExceptions) {
             throw new Exception\Http("Failed to retrieve url [{$url}]. Status code [{$req->getStatus()}]");
         } else {
             return '';
         }
     }
 }
开发者ID:riverstore,项目名称:imdbphp,代码行数:32,代码来源:Pages.php

示例3: importDumpFile

 private function importDumpFile(Project $project, $xml_svn, $extraction_path)
 {
     $attrs = $xml_svn->attributes();
     if (!isset($attrs['dump-file'])) {
         return true;
     }
     $rootpath_arg = escapeshellarg($project->getSVNRootPath());
     $dumpfile_arg = escapeshellarg("{$extraction_path}/{$attrs["dump-file"]}");
     $commandline = "svnadmin load {$rootpath_arg} <{$dumpfile_arg} 2>&1";
     $this->logger->info($commandline);
     try {
         $cmd = new System_Command();
         $command_output = $cmd->exec($commandline);
         foreach ($command_output as $line) {
             $this->logger->debug("svnadmin: {$line}");
         }
         $this->logger->debug("svnadmin returned with status 0");
     } catch (System_Command_CommandException $e) {
         foreach ($e->output as $line) {
             $this->logger->error("svnadmin: {$line}");
         }
         $this->logger->error("svnadmin returned with status {$e->return_value}");
         throw new SVNXMLImporterException("failed to svnadmin load {$dumpfile_arg} in {$rootpath_arg}:" . " exited with status {$e->return_value}");
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:25,代码来源:SVNXMLImporter.class.php

示例4: logError

 private function logError(GitRepository $repository, $sysevent_prefix, $log_prefix, Exception $e)
 {
     $this->dao->setGerritMigrationError($repository->getId());
     $this->error($sysevent_prefix . $e->getMessage());
     $this->logger->error($log_prefix . $this->verbalizeParameters(null), $e);
     $this->sendErrorNotification($repository);
 }
开发者ID:blestab,项目名称:tuleap,代码行数:7,代码来源:SystemEvent_GIT_GERRIT_MIGRATION.class.php

示例5: error

 /**
  * @param string|\Exception $msg
  * @param array $context
  * @throws \RuntimeException
  */
 public static function error($msg, array $context = array())
 {
     if (empty(static::$instance)) {
         throw new \RuntimeException('Logger instance not added to proxy yet');
     }
     static::$instance->error($msg, $context);
 }
开发者ID:zalora,项目名称:punyan,代码行数:12,代码来源:ZLog.php

示例6: parseJson

 /**
  * @param $json
  * @return PlayerState
  * @throws \MetaPlayer\JsonException
  */
 private function parseJson($json)
 {
     $playerState = $this->jsonUtils->deserialize($json);
     if (!$playerState instanceof PlayerState) {
         $this->logger->error("json should be instance of PlayerState but got " . print_r($playerState, true));
         throw new JsonException("Wrong json format.");
     }
     return $playerState;
 }
开发者ID:rigobertbot,项目名称:meta-player,代码行数:14,代码来源:StateController.php

示例7: getStore

 private function getStore()
 {
     $store_path = $this->getStorePath();
     if (!file_exists($store_path) && !mkdir($store_path)) {
         $this->logger->error("OPENID DRIVER - Unable to create Filestore self::OPENID_STORE_PATH unsufficient permissions");
         throw new OpenId_OpenIdException($GLOBALS['Language']->getText('plugin_openid', 'error_openid_store', ForgeConfig::get('sys_name')));
     }
     return new Auth_OpenID_FileStore($store_path);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:9,代码来源:ConnexionDriver.class.php

示例8: execute

 public function execute($queue)
 {
     $executed_events_ids = $this->loopOverEventsForOwner($this->getOwner(), $queue);
     try {
         $this->postEventsActions($executed_events_ids, $queue);
     } catch (Exception $exception) {
         $this->logger->error("[SystemEventProcessor] An error happened during execution of post actions: " . $exception->getMessage());
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:9,代码来源:SystemEventProcessor.class.php

示例9: push

 public static function push($msg, $code = self::GENERIC_ERROR, $severity = self::SEVERITY_ERROR)
 {
     self::init();
     self::$errors->enqueue(new Error($msg, $code, $severity));
     if ($severity == self::SEVERITY_ERROR) {
         self::$logger->error($msg);
     } else {
         self::$logger->warn($msg);
     }
 }
开发者ID:Eygle,项目名称:INeedU,代码行数:10,代码来源:ErrorManager.class.php

示例10: read

 /**
  * @return array
  */
 public function read()
 {
     $settings = [];
     try {
         $settings = Yaml::parse($this->filePath);
     } catch (ParseException $e) {
         $this->logger->error(sprintf('Unable to read the core settings file "%s".', $this->filePath));
     }
     return $settings;
 }
开发者ID:Onneil,项目名称:dedipanel,代码行数:13,代码来源:SettingsReader.php

示例11: importFromArchive

 public function importFromArchive($project_id, ZipArchive $archive)
 {
     $this->logger->info('Start importing from archive ' . $archive->filename);
     $xml_content = $archive->getFromName(self::PROJECT_XML_FILENAME);
     if (!$xml_content) {
         $this->logger->error('No content available in archive for file ' . self::PROJECT_XML_FILENAME);
         return;
     }
     return $this->importContent($project_id, $xml_content);
 }
开发者ID:uniteddiversity,项目名称:tuleap,代码行数:10,代码来源:ProjectXMLImporter.class.php

示例12: execute

 public function execute(Git_Hook_PushDetails $push_details)
 {
     $this->log_pushes->executeForRepository($push_details);
     foreach ($push_details->getRevisionList() as $commit) {
         try {
             $this->extract_cross_ref->execute($push_details, $commit);
         } catch (Git_Command_Exception $exception) {
             $this->logger->error(__CLASS__ . ": cannot extract references for {$push_details->getRepository()->getFullPath()} {$push_details->getRefname()} {$commit}: {$exception}");
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:ParseLog.class.php

示例13: launchForRepository

 private function launchForRepository(GitRepository $repository)
 {
     $res = $this->dao->retrieveTriggersPathByRepository($repository->getId());
     if ($res && !$res->isError() && $res->rowCount() > 0) {
         foreach ($res as $row) {
             try {
                 $this->jenkins_client->setToken($row['token'])->launchJobBuild($row['job_url']);
             } catch (Exception $exception) {
                 $this->logger->error(__CLASS__ . '[' . $repository->getId() . '] ' . $exception->getMessage());
             }
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:13,代码来源:Launcher.class.php

示例14: importFromArchive

 public function importFromArchive($project_id, ZipArchive $archive)
 {
     $this->logger->info('Start importing from archive ' . $archive->filename);
     $project_archive = $this->getProjectZipArchive($archive, $project_id);
     $xml_content = $project_archive->getXML();
     if (!$xml_content) {
         $this->logger->error('No content available in archive for file ' . ProjectXMLImporter_XMLImportZipArchive::PROJECT_XML_FILENAME);
         return;
     }
     $project_archive->extractFiles();
     $this->importContent($project_id, $xml_content, $project_archive->getExtractionPath());
     return $project_archive->cleanUp();
 }
开发者ID:superlinger,项目名称:tuleap,代码行数:13,代码来源:ProjectXMLImporter.class.php

示例15: LogAdmActivity

function LogAdmActivity($usrName, $activity, $oldVal = '', $newVal = '', $note = '')
{
    $sqlStatement = "INSERT INTO adm_activity (user_login, aktivita, stara_hodnota, nova_hodnota, poznamka) VALUES ('{$usrName}', '{$activity}', '{$oldVal}', '{$newVal}', '{$note}')";
    if (!sql($sqlStatement)) {
        Logger::error("Nepodarilo sa zapisat do admin-logu v DB. SQL:\n{$sqlStatement}");
    }
}
开发者ID:novacek78,项目名称:v4,代码行数:7,代码来源:admin.php


注:本文中的Logger::error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。