1: <?php
2:
3: namespace Guzzle\Log;
4:
5: /**
6: * Stores all log messages in an array
7: */
8: class ArrayLogAdapter implements LogAdapterInterface
9: {
10: protected $logs = array();
11:
12: /**
13: * {@inheritdoc}
14: */
15: public function log($message, $priority = LOG_INFO, $extras = null)
16: {
17: $this->logs[] = array('message' => $message, 'priority' => $priority, 'extras' => $extras);
18: }
19:
20: /**
21: * Get logged entries
22: *
23: * @return array
24: */
25: public function getLogs()
26: {
27: return $this->logs;
28: }
29:
30: /**
31: * Clears logged entries
32: */
33: public function clearLogs()
34: {
35: $this->logs = array();
36: }
37: }
38: