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: /**
 6:  * Logs messages using Closures. Closures combined with filtering can trigger application events based on log messages.
 7:  */
 8: class ClosureLogAdapter extends AbstractLogAdapter
 9: {
10:     /**
11:      * {@inheritdoc}
12:      */
13:     public function __construct($logObject)
14:     {
15:         if (!is_callable($logObject)) {
16:             throw new \InvalidArgumentException('Object must be callable');
17:         }
18: 
19:         $this->log = $logObject;
20:     }
21: 
22:     /**
23:      * {@inheritdoc}
24:      */
25:     public function log($message, $priority = LOG_INFO, $extras = null)
26:     {
27:         call_user_func($this->log, $message, $priority, $extras);
28:     }
29: }
30: 
php-coveralls API documentation generated by ApiGen 2.8.0