本文整理汇总了PHP中Logger::info方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::info方法的具体用法?PHP Logger::info怎么用?PHP Logger::info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logger
的用法示例。
在下文中一共展示了Logger::info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: info
/**
* @param string|\Exception $msg
* @param array $context
* @throws \RuntimeException
*/
public static function info($msg, array $context = array())
{
if (empty(static::$instance)) {
throw new \RuntimeException('Logger instance not added to proxy yet');
}
static::$instance->info($msg, $context);
}
示例2: log
/**
* log if verbose mode active
*
* @param OutputInterface $output The output
* @param string $message The message
*/
protected function log(OutputInterface $output, $message)
{
if (null === $this->logger) {
$this->logger = new CommandLogger($output);
}
$this->logger->info($message);
}
示例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}");
}
}
示例4: 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 '';
}
}
}
示例5: getPayments
/**
* Get parsed payments
*
* @return \ArrayObject Payments array
*/
public function getPayments()
{
if ($this->_payments->count() == 0) {
$this->_logger->info("No payments found, did you invoke Parser::parse() before this call?");
}
return $this->_payments;
}
示例6: initialize
public function initialize()
{
// check if user is logged in
$authentication = Authentication::getInstance();
$request = Request::getInstance();
if ($authentication->isLogin() && !$authentication->isRole(SystemUser::ROLE_BACKEND)) {
$this->log->info("Failed access for " . $authentication->getUserName() . " (not enough privileges for admin section) from " . $request->getValue('REMOTE_ADDR', Request::SERVER));
throw new Exception('Access denied');
}
// check if admin section is restricted by ip-addresses
$ip_allow = $this->director->getConfig()->admin_section_ip_allow;
if ($ip_allow) {
$ips = explode(",", $ip_allow);
if (!in_array($request->getValue('REMOTE_ADDR', Request::SERVER), $ips)) {
$this->log->info("Failed access for " . $authentication->getUserName() . " (ip not in list for admin access) from " . $request->getValue('REMOTE_ADDR', Request::SERVER));
throw new Exception('Access denied');
}
}
// create tree object
$treefile = Director::getConfigPath() . $this->director->getConfig()->admin_menu;
$useLogin = $this->director->getConfig()->dsn;
$this->tree = new AdminTree($treefile, $useLogin);
$this->tree->setPrefix($this->urlPrefix);
// check if path is set. is not, get the startpage path
$path = $request->getPath();
$currentId = $this->tree->isSiteRoot() ? $this->tree->getStartNodeId() : $this->tree->getIdFromPath($path);
// current id does not exist. try to search login pages
if (!$currentId && $this->tree->pathExists($path)) {
$this->tree->setCurrentIdExists($this->tree->getIdFromPath($path, Tree::TREE_ORIGINAL));
}
$this->tree->setCurrentId($currentId);
}
示例7: cleanUpGitoliteAdminWorkingCopy
public function cleanUpGitoliteAdminWorkingCopy()
{
if ($this->dao->isGitGcEnabled()) {
$this->logger->info('Running git gc on gitolite admin working copy.');
$this->execGitGcAsAppAdm();
} else {
$this->logger->warn('Cannot run git gc on gitolite admin working copy. ' . 'Please run as root: /usr/share/codendi/src/utils/php-launcher.sh ' . '/usr/share/codendi/plugins/git/bin/gl-admin-housekeeping.php');
}
}
示例8: importLanguage
private function importLanguage(Project $project, $language)
{
$this->logger->info("Set language to {$language} for {$project->getUnixName()}");
try {
$this->language_manager->saveLanguageOption($project, $language);
} catch (Mediawiki_UnsupportedLanguageException $e) {
$this->logger->warn("Could not set up the language for {$project->getUnixName()} mediawiki, {$language} is not sopported.");
}
}
示例9: exportArtifact
public function exportArtifact($tracker_id, array $artifact_row)
{
$artifact_id = (int) $artifact_row['artifact_id'];
$this->logger->info("Export artifact: " . $artifact_id);
$artifact_node = $this->node_helper->createElement('artifact');
$artifact_node->setAttribute('id', $artifact_row['artifact_id']);
$this->addAllChangesets($artifact_node, $tracker_id, $artifact_id, $artifact_row);
$this->attachment_exporter->addFilesToArtifact($artifact_node, $tracker_id, $artifact_id);
return $artifact_node;
}
示例10: export
public function export(Project $project, array $options, PFUser $user, ZipArchive $archive)
{
$this->logger->info("Start exporting project " . $project->getPublicName());
$xml_element = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?>
<project />');
$this->exportProjectUgroups($project, $xml_element);
$this->exportPlugins($project, $xml_element, $options, $user, $archive);
$this->logger->info("Finish exporting project " . $project->getPublicName());
return $this->convertToXml($xml_element);
}
示例11: send
/**
* Отправляет СМС на указанный номер
*
* @param string $phoneNumber
* @param string $message
* @param int $GROUP 14 - tele-plus
*
* @throws \InvalidArgumentException телефонный номер пустой
*/
public function send($phoneNumber, $message, $GROUP = self::GROUP_TELEPLUS)
{
//Не проверяет телефон на мобильный он или городской, потому что возможно на короткий городской тоже отправляет СМС
$this->_logger->info("{$phoneNumber}, {$message}, {$GROUP}");
if (!$this->getClearPhoneNumber($phoneNumber)) {
throw new \InvalidArgumentException("Пустой телефонный номер");
}
if (!$message) {
throw new \InvalidArgumentException("Пустое СМС сообщение");
}
$connection = Core::getConnection();
$connection->exec("INSERT INTO TMCOMDEVS_TASKS(KIND, STATUS, SMSMESSAGE, PHONE, ORDID, CREW_GROUP_ID) VALUES (1, 0, {$connection->quote($message)}, '{$this->getClearPhoneNumber($phoneNumber)}', Null, {$GROUP})");
}
示例12: process
public function process($raw_mail)
{
$incoming_message = $this->parser->parse($raw_mail);
$user = $incoming_message->getRecipient()->getUser();
$artifact = $incoming_message->getRecipient()->getArtifact();
$this->logger->debug("Receiving new follow-up comment from " . $user->getUserName());
if (!$artifact->userCanUpdate($user)) {
$this->logger->info("User " . $user->getUnixName() . " has no right to update the artifact #" . $artifact->getId());
return;
}
$body = $this->citation_stripper->stripText($incoming_message->getBody());
$artifact->createNewChangeset(array(), $body, $user, true, Tracker_Artifact_Changeset_Comment::TEXT_COMMENT);
}
示例13: executeSystemEvent
private function executeSystemEvent(SystemEvent $sysevent)
{
$this->logger->info("Processing event #" . $sysevent->getId() . " " . $sysevent->getType() . "(" . $sysevent->getParameters() . ")");
try {
$sysevent->process();
} catch (Exception $exception) {
$sysevent->logException($exception);
}
$this->dao->close($sysevent);
$sysevent->notify();
$this->logger->info("Processing event #" . $sysevent->getId() . ": done.", Backend::LOG_INFO);
// Output errors???
}
示例14: query
/**
* @param string $statement
* @return mixed
*/
public function query($statement)
{
# Execute
$start = microtime(true);
$result = call_user_func_array('parent::query', func_get_args());
$time = microtime(true) - $start;
# Explain
$explain = new Explain($this, $statement);
# Log
if (!preg_match('/^\\s*(EXPLAIN)\\s+/i', $statement)) {
$this->logger->info('query', array('queryString' => $statement, 'parameters' => array(), 'time' => $time, 'explain' => $explain->getResult(), 'backtrace' => debug_backtrace()));
}
# Return
return $result;
}
示例15: execute
/**
* @param array $parameters
*/
public function execute($parameters = array())
{
# Execute
$start = microtime(true);
$result = $this->sth->execute($parameters);
$time = microtime(true) - $start;
# Explain
$explain = new Explain($this->pdo, $this->sth->queryString, $parameters);
# Log
if (!preg_match('/^\\s*(EXPLAIN)\\s+/i', $this->sth->queryString)) {
$this->logger->info('prepare', array('queryString' => $this->sth->queryString, 'parameters' => $parameters, 'time' => $time, 'explain' => $explain->getResult(), 'backtrace' => debug_backtrace()));
}
# Return
return $result;
}