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


PHP Logger::info方法代码示例

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


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

示例1: log

 protected function log($log)
 {
     if (is_array($log)) {
         $log = print_r($log, true);
     }
     $this->logger->info($log);
 }
开发者ID:zhangyuxiao,项目名称:qoros,代码行数:7,代码来源:WechatUtil.php

示例2: initProfiler

 /**
  * Init profiler
  */
 public function initProfiler(MvcEvent $e)
 {
     try {
         $writer = new FirePhp();
         $logger = new Logger();
         $logger->addWriter($writer);
         $logger->info('memory usage: ' . memory_get_usage(true) / 1024 / 1024 . 'Mb');
         $logger->info('page execution time: ' . (microtime(true) - APPLICATION_START));
         // get sql profiler
         if (null !== ($sqlProfiler = $this->serviceLocator->get('Zend\\Db\\Adapter\\Adapter')->getProfiler())) {
             $queriesTotalTime = 0;
             foreach ($sqlProfiler->getProfiles() as $query) {
                 $base = ['time' => $query['elapse'], 'query' => $query['sql']];
                 $queriesTotalTime += $query['elapse'];
                 if (!empty($query['parameters'])) {
                     $params = [];
                     foreach ($query['parameters'] as $key => $value) {
                         $params[$key] = $value;
                     }
                     $base['params'] = $params;
                 }
                 $logger->info('', $base);
             }
             $logger->info('sql queries total execution time: ' . $queriesTotalTime);
         }
     } catch (Exception $e) {
         ApplicationErrorLogger::log($e);
     }
 }
开发者ID:spooner77,项目名称:dream-cms,代码行数:32,代码来源:Module.php

示例3: info

 /**
  * Log de info
  * @param  string $pathLog caminho do erro
  * @param  string $message mensagem de erro
  * @return boolean
  */
 public static function info($pathLog, $message)
 {
     self::createLogger();
     self::$logger->addWriter(new \Zend\Log\Writer\Stream($pathLog . DIRECTORY_SEPARATOR . "info.log"));
     self::$logger->info($message);
     self::destroyLogger();
     return TRUE;
 }
开发者ID:brunosccp1910,项目名称:XSADMIN,代码行数:14,代码来源:Log.php

示例4: stopQuery

 public function stopQuery()
 {
     if ($this->enabled) {
         parent::stopQuery();
         $q = $this->queries[$this->currentQuery];
         $message = "Executed Query:  " . print_r($q, true);
         $this->logger->info($message);
     }
 }
开发者ID:eddiejaoude,项目名称:doctrine2-logger,代码行数:9,代码来源:Log.php

示例5: testSetSubjectPrependText

 public function testSetSubjectPrependText()
 {
     $this->writer->setSubjectPrependText('test');
     $this->log->info('an info message');
     $this->log->info('a second info message');
     unset($this->log);
     $contents = file_get_contents(__DIR__ . '/' . self::FILENAME);
     $this->assertContains('an info message', $contents);
     $this->assertContains('Subject: test', $contents);
 }
开发者ID:nieldm,项目名称:zf2,代码行数:10,代码来源:MailTest.php

示例6: logMessage

 /**
  * Log a message
  *
  * @param string $message Message to be logged
  */
 public function logMessage($message)
 {
     $this->logger->info(strip_tags($message));
     if ($this->sendToBrowser) {
         $this->sendMessageToBrowser($message);
     }
     if ($this->sendToCli) {
         $this->sendMessageToCli($message);
     }
 }
开发者ID:reliv,项目名称:rcm,代码行数:15,代码来源:Logger.php

示例7: logIssues

 /**
  * @return bool
  */
 private function logIssues()
 {
     if (!$this->isVerbose()) {
         return false;
     }
     $form = $this->userService->getRegisterForm();
     foreach ($form->getMessages() as $key => $messages) {
         foreach ($messages as $issueKey => $issueMessage) {
             $this->logger->info($key . '/' . $issueKey . ': ' . $issueMessage);
         }
     }
     return true;
 }
开发者ID:peteraba,项目名称:dm-mailercli,代码行数:16,代码来源:UserController.php

示例8: run

 public function run(Command $cmd)
 {
     $command = $this->bin . ' ' . (string) $cmd;
     $this->logger->debug('Command : `' . $command . '``');
     $proc = popen((string) $command, 'r');
     while (($line = fgets($proc)) !== false) {
         foreach ($this->handler as $handler) {
             $handler->handle($line, $this, $cmd);
         }
     }
     $this->logger->info('Done.');
     /** @var HandlerInterface[] $handlers */
     return array_merge($this->handler, $this->ignoredHandler);
 }
开发者ID:eoko,项目名称:wpscan,代码行数:14,代码来源:Client.php

示例9: showAction

 public function showAction()
 {
     $url = $this->getEvent()->getRouteMatch()->getParam('url');
     $this->logger->info('Preparing scan for `' . $url . '`');
     $client = $this->client;
     $client->addHandler(new UrlHandler());
     $client->addHandler(new PluginHandler());
     $client->addHandler(new TemplateHandler());
     $command = new Command();
     $command->addArgs(new Url($url));
     $command->addArgs(new FakeUserAgent());
     $result = $client->run($command);
     foreach ($result as $handler) {
         $this->console->writeLine($handler->__toString());
     }
 }
开发者ID:eoko,项目名称:wpscan,代码行数:16,代码来源:IndexController.php

示例10: onMailSent

 /**
  * Callback function invoking on successful mail sent
  *
  * @param Event $e
  */
 public function onMailSent(Event $e)
 {
     /* @var Message */
     $message = $e->getTarget();
     $addressList = $this->prepareAddressList($message);
     $this->logger->info(sprintf("E-mail '%s' has been sent to following recipients: %s", $message->getSubject(), implode(', ', $addressList)));
 }
开发者ID:guliano,项目名称:esco-mail,代码行数:12,代码来源:MailLogger.php

示例11: console

 /**
  * console($text, $exception = false, $exit = false) Output console message
  * @param string $data stdout data
  * @param boolean $exception throwed Eception
  * @param boolean $exit die console out
  * @acceess public
  */
 public function console($data, $exception = false, $exit = false)
 {
     // check if console is usable
     if (true === $this->config['debug']) {
         if (is_array($data) || is_object($data)) {
             Debug::dump($data . '', date('[Y-m-d H:i:s]') . ' [DEBUG]');
             if (isset($this->__log)) {
                 $this->_logger->info($data);
             }
         } else {
             if (!is_resource($data)) {
                 $data = mb_convert_encoding($data, $this->config['encoding']);
             }
             $text = date('[Y-m-d H:i:s]') . '[DEBUG] ' . $data . "\r\n";
             if ($exception) {
                 if ($this->__log) {
                     $this->_logger->crit($text);
                 }
                 throw new Exception\ExceptionStrategy($text);
             } else {
                 if ($this->__log) {
                     $this->_logger->info($text);
                 }
                 echo $text;
             }
         }
         if ($exit) {
             $this->shutdown();
         }
     }
 }
开发者ID:stanislav-web,项目名称:zf2-websocket-server-factory,代码行数:38,代码来源:WebsocketServer.php

示例12: closeSentMessage

 /**
  * @param Message $message
  *
  * @return bool
  */
 private function closeSentMessage(Message $message)
 {
     $queue = $message->getQueue();
     if (empty($queue)) {
         return false;
     }
     $allSent = true;
     foreach ($queue as $queueItem) {
         if (null === $queueItem->getSentAt()) {
             $allSent = false;
             break;
         }
     }
     if ($this->isVerbose()) {
         $messageAsString = $this->messageToString($message, count($queue));
         if ($allSent) {
             $this->logger->info('Message to be closed: ' . $messageAsString);
         } else {
             $this->logger->info('Message is still being sent: ' . $messageAsString);
         }
     }
     if ($allSent) {
         $this->messageRepository->closeMessage($message);
         return true;
     }
     return false;
 }
开发者ID:peteraba,项目名称:dm-mailercli,代码行数:32,代码来源:MessageController.php

示例13: transactionReceived

 public function transactionReceived(string $address, float $amount)
 {
     $this->logger->notice("Received transaction to address {$address}");
     $stmt = $this->connection->prepare('UPDATE addresses SET last_used = NULL WHERE address = :address');
     $stmt->execute([':address' => $address]);
     $addressMaxAge = new \DateTime($this->addressLockTime);
     $stmt = $this->connection->prepare('SELECT id, ordered_genre_id, price FROM orders WHERE address = :address AND ordered > :maxAge AND paid = FALSE');
     $stmt->execute([':address' => $address, ':maxAge' => $addressMaxAge->format("Y-m-d H:i:s")]);
     $result = $stmt->fetch(PDO::FETCH_ASSOC);
     $orderId = $result['id'];
     $orderedGenreId = $result['ordered_genre_id'];
     $price = $result['price'];
     if ($price > $amount) {
         //if paid amount is smaller than ordered price
         return;
     }
     $stmt = $this->connection->prepare('UPDATE orders SET paid = TRUE WHERE address = :address AND ordered > :maxAge AND paid = FALSE');
     $stmt->execute([':address' => $address, ':maxAge' => $addressMaxAge->format("Y-m-d H:i:s")]);
     if ($orderedGenreId != null) {
         file_put_contents($this->currentGenreFile, $orderedGenreId);
     }
     $this->logger->info("{$orderId} has been paid");
     $stmt = $this->connection->prepare('UPDATE queue SET paid = TRUE WHERE order_id = :id');
     $stmt->execute([':id' => $orderId]);
 }
开发者ID:ParalelniPolis,项目名称:bitcoinJukebox,代码行数:25,代码来源:TransactionReader.php

示例14: logInfo

 /**
  *
  * @param string $message            
  * @param array $extra            
  */
 public static function logInfo($message, array $extra = array())
 {
     if (is_null(self::$logger)) {
         throw new ProcessException("Impossible de loguer le message d'information : " . $message);
     } else {
         self::$logger->info($message, $extra);
     }
 }
开发者ID:dsi-agpt,项目名称:minibus,代码行数:13,代码来源:AbstractDataTransferAgent.php

示例15: perform

 public function perform()
 {
     $queueName = isset($this->args['name']) ? $this->args['name'] : 'error';
     $writer = new Log\Writer\Stream(EVA_PUBLIC_PATH . '/logs/' . $queueName . '.log');
     $logger = new Log\Logger();
     $logger->addWriter($writer);
     $logger->info("Worker {$queueName} is working");
 }
开发者ID:ahyswang,项目名称:eva-engine,代码行数:8,代码来源:TestJob.php


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