mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-30 08:56:07 +03:00
35 lines
615 B
PHP
35 lines
615 B
PHP
<?php
|
|
|
|
namespace Guzzle\Log;
|
|
|
|
/**
|
|
* Stores all log messages in an array
|
|
*/
|
|
class ArrayLogAdapter implements LogAdapterInterface
|
|
{
|
|
protected $logs = array();
|
|
|
|
public function log($message, $priority = LOG_INFO, $extras = array())
|
|
{
|
|
$this->logs[] = array('message' => $message, 'priority' => $priority, 'extras' => $extras);
|
|
}
|
|
|
|
/**
|
|
* Get logged entries
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getLogs()
|
|
{
|
|
return $this->logs;
|
|
}
|
|
|
|
/**
|
|
* Clears logged entries
|
|
*/
|
|
public function clearLogs()
|
|
{
|
|
$this->logs = array();
|
|
}
|
|
}
|