Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • AbstractLogAdapter
  • ArrayLogAdapter
  • ClosureLogAdapter
  • MessageFormatter
  • MonologLogAdapter
  • PsrLogAdapter
  • Zf1LogAdapter
  • Zf2LogAdapter

Interfaces

  • LogAdapterInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: namespace Guzzle\Log;
 4: 
 5: use Psr\Log\LogLevel;
 6: use Psr\Log\LoggerInterface;
 7: 
 8: /**
 9:  * PSR-3 log adapter
10:  *
11:  * @link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
12:  */
13: class PsrLogAdapter extends AbstractLogAdapter
14: {
15:     /**
16:      * syslog to PSR-3 mappings
17:      */
18:     private static $mapping = array(
19:         LOG_DEBUG   => LogLevel::DEBUG,
20:         LOG_INFO    => LogLevel::INFO,
21:         LOG_WARNING => LogLevel::WARNING,
22:         LOG_ERR     => LogLevel::ERROR,
23:         LOG_CRIT    => LogLevel::CRITICAL,
24:         LOG_ALERT   => LogLevel::ALERT
25:     );
26: 
27:     /**
28:      * {@inheritdoc}
29:      */
30:     public function __construct(LoggerInterface $logObject)
31:     {
32:         $this->log = $logObject;
33:     }
34: 
35:     /**
36:      * {@inheritdoc}
37:      */
38:     public function log($message, $priority = LOG_INFO, $extras = null)
39:     {
40: 
41:         $this->log->log(self::$mapping[$priority], $message, $extras);
42:     }
43: }
44: 
php-coveralls API documentation generated by ApiGen 2.8.0