本文整理汇总了PHP中Zend\Log\Logger::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::debug方法的具体用法?PHP Logger::debug怎么用?PHP Logger::debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Log\Logger
的用法示例。
在下文中一共展示了Logger::debug方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: doRequest
public static function doRequest($url, array $postData = null, $method = Request::METHOD_GET)
{
$client = self::getClientInstance();
$client->resetParameters();
$client->setEncType(Client::ENC_URLENCODED);
$client->setUri($url);
$client->setMethod($method);
if ($postData === null) {
$postData = array();
}
$postData['access_token'] = self::getSession()->accessToken;
if ($method == Request::METHOD_POST && $postData !== null) {
$client->setParameterPost($postData);
}
if (($method == Request::METHOD_GET || $method == Request::METHOD_DELETE) && $postData !== null) {
$client->setParameterGet($postData);
}
$response = $client->send();
if ($response->isSuccess()) {
return JsonDecoder::decode($response->getBody(), Json::TYPE_ARRAY);
} else {
$logger = new Logger();
$logger->addWriter(new Stream('data/logs/apiclient.log'));
$logger->debug($response->getBody());
return FALSE;
}
}
示例3: log
public function log()
{
$mailLog = null;
/** @var \Zend\Mail\Transport\Smtp $mailTransport */
$mailTransport = $this->sxMail->getTransport();
if ($mailTransport instanceof \Zend\Mail\Transport\Smtp || is_callable([$mailTransport, 'getConnection'])) {
$mailLog = $mailTransport->getConnection()->getLog();
}
if ($mailLog) {
$this->logger->debug($mailLog);
}
}
示例4: error
/**
* Log data into the exception log file.
*
* @param $title
* @param $error
*/
public function error($title, $error)
{
$this->connectorLogger->debug($title, $error);
}
示例5: doRequest
/**
* Perform a request to the API
*
* @param string $url
* @param array $postData
* @param Client $client
* @return Zend\Http\Response
* @author Christopher
*/
protected static function doRequest($url, array $postData = null, $method = Request::METHOD_GET)
{
$client = self::getClientInstance();
$client->setUri($url);
$client->setMethod($method);
if ($postData !== null) {
$client->setParameterPost($postData);
}
$response = $client->send();
if ($response->isSuccess()) {
return JsonDecoder::decode($response->getBody(), Json::TYPE_ARRAY);
} else {
$logger = new Logger();
$logger->addWriter(new Stream('data/logs/apiclient.log'));
$logger->debug($response->getBody());
return FALSE;
}
}
示例6: loggingQuery
public function loggingQuery($adapter)
{
$logger = new Logger();
$writer = new Stream(LOG_DIR . "/query/" . date('Y-m-d'));
$logger->addWriter($writer);
$profiler = new Profiler();
$adapter->setProfiler($profiler);
$profiler->profilerStart(new StatementContainer());
register_shutdown_function(function () use($logger, $profiler) {
$profilers = $profiler->getProfiles();
if ($profilers) {
foreach ($profilers as $profile) {
$logger->debug($profile['sql']);
}
}
});
}
示例7: testLogWritesWithModifiedTimestampFormat
/**
* @group ZF-9870
*/
public function testLogWritesWithModifiedTimestampFormat()
{
$logger = new Logger($this->writer);
$logger->setTimestampFormat('Y-m-d');
$logger->debug('ZF-9870');
rewind($this->log);
$message = stream_get_contents($this->log);
$this->assertEquals(date('Y-m-d'), substr($message, 0, 10));
}
示例8: log
public function log($text)
{
$this->logger->debug($text);
}
示例9: doRequestAuth
/**
* Perform a request to the API
*
* @param string $url
* @param array $postData
* @param Client $client
* @return Zend\Http\Response
*/
protected static function doRequestAuth($url, $decodeType = Json::TYPE_OBJECT, array $postData = null, $method = Request::METHOD_GET)
{
$client = self::getClientInstance();
$client->setUri($url);
$client->setMethod($method);
if ($postData !== null) {
$client->setParameterPost($postData);
}
$client->setHeaders(array('Accept' => 'application/vnd.music.v1+json', 'Content-Type' => 'application/json', 'Accept-Encoding' => 'UTF-8', 'Authorization' => self::$token->token_type . ' ' . self::$token->access_token));
if ($postData !== null) {
$client->setRawBody(Json::encode($postData, true));
$client->setEncType('application/json');
}
$response = $client->send();
if ($response->isSuccess()) {
return JsonDecoder::decode($response->getBody(), $decodeType);
} else {
// FIXME: Remove on production
$logger = new Logger();
$logger->addWriter(new Stream('data/logs/apiclient.log'));
$logger->debug($response->getBody());
return $response->getBody();
}
}
示例10: debug
/**
* Log a debug message.
*
* @param string $msg Message to log.
*
* @return void
*/
protected function debug($msg)
{
if ($this->logger) {
$this->logger->debug($msg);
}
}
示例11: debugPrint
/**
* Print a message if debug is enabled.
*
* @param string $msg Message to print
*
* @return void
*/
protected function debugPrint($msg)
{
if ($this->debug && $this->logger) {
$this->logger->debug("{$msg}\n");
}
}