[
  {
    "path": ".gitattributes",
    "content": ".gitattributes export-ignore\n.gitignore export-ignore\n"
  },
  {
    "path": ".gitignore",
    "content": "vendor\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2012 PHP Framework Interoperability Group\n\nPermission is hereby granted, free of charge, to any person obtaining a copy \nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights \nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell \ncopies of the Software, and to permit persons to whom the Software is \nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in \nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "PSR Log\n=======\n\nThis repository holds all interfaces/classes/traits related to\n[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md).\n\nNote that this is not a logger of its own. It is merely an interface that\ndescribes a logger. See the specification for more details.\n\nInstallation\n------------\n\n```bash\ncomposer require psr/log\n```\n\nUsage\n-----\n\nIf you need a logger, you can use the interface like this:\n\n```php\n<?php\n\nuse Psr\\Log\\LoggerInterface;\n\nclass Foo\n{\n    private $logger;\n\n    public function __construct(LoggerInterface $logger = null)\n    {\n        $this->logger = $logger;\n    }\n\n    public function doSomething()\n    {\n        if ($this->logger) {\n            $this->logger->info('Doing work');\n        }\n           \n        try {\n            $this->doSomethingElse();\n        } catch (Exception $exception) {\n            $this->logger->error('Oh no!', array('exception' => $exception));\n        }\n\n        // do something useful\n    }\n}\n```\n\nYou can then pick one of the implementations of the interface to get a logger.\n\nIf you want to implement the interface, you can require this package and\nimplement `Psr\\Log\\LoggerInterface` in your code. Please read the\n[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)\nfor details.\n"
  },
  {
    "path": "composer.json",
    "content": "{\n    \"name\": \"psr/log\",\n    \"description\": \"Common interface for logging libraries\",\n    \"keywords\": [\"psr\", \"psr-3\", \"log\"],\n    \"homepage\": \"https://github.com/php-fig/log\",\n    \"license\": \"MIT\",\n    \"authors\": [\n        {\n            \"name\": \"PHP-FIG\",\n            \"homepage\": \"https://www.php-fig.org/\"\n        }\n    ],\n    \"require\": {\n        \"php\": \">=8.0.0\"\n    },\n    \"autoload\": {\n        \"psr-4\": {\n            \"Psr\\\\Log\\\\\": \"src\"\n        }\n    },\n    \"extra\": {\n        \"branch-alias\": {\n            \"dev-master\": \"3.x-dev\"\n        }\n    }\n}\n"
  },
  {
    "path": "src/AbstractLogger.php",
    "content": "<?php\n\nnamespace Psr\\Log;\n\n/**\n * This is a simple Logger implementation that other Loggers can inherit from.\n *\n * It simply delegates all log-level-specific methods to the `log` method to\n * reduce boilerplate code that a simple Logger that does the same thing with\n * messages regardless of the error level has to implement.\n */\nabstract class AbstractLogger implements LoggerInterface\n{\n    use LoggerTrait;\n}\n"
  },
  {
    "path": "src/InvalidArgumentException.php",
    "content": "<?php\n\nnamespace Psr\\Log;\n\nclass InvalidArgumentException extends \\InvalidArgumentException\n{\n}\n"
  },
  {
    "path": "src/LogLevel.php",
    "content": "<?php\n\nnamespace Psr\\Log;\n\n/**\n * Describes log levels.\n */\nclass LogLevel\n{\n    const EMERGENCY = 'emergency';\n    const ALERT     = 'alert';\n    const CRITICAL  = 'critical';\n    const ERROR     = 'error';\n    const WARNING   = 'warning';\n    const NOTICE    = 'notice';\n    const INFO      = 'info';\n    const DEBUG     = 'debug';\n}\n"
  },
  {
    "path": "src/LoggerAwareInterface.php",
    "content": "<?php\n\nnamespace Psr\\Log;\n\n/**\n * Describes a logger-aware instance.\n */\ninterface LoggerAwareInterface\n{\n    /**\n     * Sets a logger instance on the object.\n     */\n    public function setLogger(LoggerInterface $logger): void;\n}\n"
  },
  {
    "path": "src/LoggerAwareTrait.php",
    "content": "<?php\n\nnamespace Psr\\Log;\n\n/**\n * Basic Implementation of LoggerAwareInterface.\n */\ntrait LoggerAwareTrait\n{\n    /**\n     * The logger instance.\n     */\n    protected ?LoggerInterface $logger = null;\n\n    /**\n     * Sets a logger.\n     */\n    public function setLogger(LoggerInterface $logger): void\n    {\n        $this->logger = $logger;\n    }\n}\n"
  },
  {
    "path": "src/LoggerInterface.php",
    "content": "<?php\n\nnamespace Psr\\Log;\n\n/**\n * Describes a logger instance.\n *\n * The message MUST be a string or object implementing __toString().\n *\n * The message MAY contain placeholders in the form: {foo} where foo\n * will be replaced by the context data in key \"foo\".\n *\n * The context array can contain arbitrary data. The only assumption that\n * can be made by implementors is that if an Exception instance is given\n * to produce a stack trace, it MUST be in a key named \"exception\".\n *\n * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md\n * for the full interface specification.\n */\ninterface LoggerInterface\n{\n    /**\n     * System is unusable.\n     *\n     * @param mixed[] $context\n     */\n    public function emergency(string|\\Stringable $message, array $context = []): void;\n\n    /**\n     * Action must be taken immediately.\n     *\n     * Example: Entire website down, database unavailable, etc. This should\n     * trigger the SMS alerts and wake you up.\n     *\n     * @param mixed[] $context\n     */\n    public function alert(string|\\Stringable $message, array $context = []): void;\n\n    /**\n     * Critical conditions.\n     *\n     * Example: Application component unavailable, unexpected exception.\n     *\n     * @param mixed[] $context\n     */\n    public function critical(string|\\Stringable $message, array $context = []): void;\n\n    /**\n     * Runtime errors that do not require immediate action but should typically\n     * be logged and monitored.\n     *\n     * @param mixed[] $context\n     */\n    public function error(string|\\Stringable $message, array $context = []): void;\n\n    /**\n     * Exceptional occurrences that are not errors.\n     *\n     * Example: Use of deprecated APIs, poor use of an API, undesirable things\n     * that are not necessarily wrong.\n     *\n     * @param mixed[] $context\n     */\n    public function warning(string|\\Stringable $message, array $context = []): void;\n\n    /**\n     * Normal but significant events.\n     *\n     * @param mixed[] $context\n     */\n    public function notice(string|\\Stringable $message, array $context = []): void;\n\n    /**\n     * Interesting events.\n     *\n     * Example: User logs in, SQL logs.\n     *\n     * @param mixed[] $context\n     */\n    public function info(string|\\Stringable $message, array $context = []): void;\n\n    /**\n     * Detailed debug information.\n     *\n     * @param mixed[] $context\n     */\n    public function debug(string|\\Stringable $message, array $context = []): void;\n\n    /**\n     * Logs with an arbitrary level.\n     *\n     * @param mixed $level\n     * @param mixed[] $context\n     *\n     * @throws \\Psr\\Log\\InvalidArgumentException\n     */\n    public function log($level, string|\\Stringable $message, array $context = []): void;\n}\n"
  },
  {
    "path": "src/LoggerTrait.php",
    "content": "<?php\n\nnamespace Psr\\Log;\n\n/**\n * This is a simple Logger trait that classes unable to extend AbstractLogger\n * (because they extend another class, etc) can include.\n *\n * It simply delegates all log-level-specific methods to the `log` method to\n * reduce boilerplate code that a simple Logger that does the same thing with\n * messages regardless of the error level has to implement.\n */\ntrait LoggerTrait\n{\n    /**\n     * System is unusable.\n     */\n    public function emergency(string|\\Stringable $message, array $context = []): void\n    {\n        $this->log(LogLevel::EMERGENCY, $message, $context);\n    }\n\n    /**\n     * Action must be taken immediately.\n     *\n     * Example: Entire website down, database unavailable, etc. This should\n     * trigger the SMS alerts and wake you up.\n     */\n    public function alert(string|\\Stringable $message, array $context = []): void\n    {\n        $this->log(LogLevel::ALERT, $message, $context);\n    }\n\n    /**\n     * Critical conditions.\n     *\n     * Example: Application component unavailable, unexpected exception.\n     */\n    public function critical(string|\\Stringable $message, array $context = []): void\n    {\n        $this->log(LogLevel::CRITICAL, $message, $context);\n    }\n\n    /**\n     * Runtime errors that do not require immediate action but should typically\n     * be logged and monitored.\n     */\n    public function error(string|\\Stringable $message, array $context = []): void\n    {\n        $this->log(LogLevel::ERROR, $message, $context);\n    }\n\n    /**\n     * Exceptional occurrences that are not errors.\n     *\n     * Example: Use of deprecated APIs, poor use of an API, undesirable things\n     * that are not necessarily wrong.\n     */\n    public function warning(string|\\Stringable $message, array $context = []): void\n    {\n        $this->log(LogLevel::WARNING, $message, $context);\n    }\n\n    /**\n     * Normal but significant events.\n     */\n    public function notice(string|\\Stringable $message, array $context = []): void\n    {\n        $this->log(LogLevel::NOTICE, $message, $context);\n    }\n\n    /**\n     * Interesting events.\n     *\n     * Example: User logs in, SQL logs.\n     */\n    public function info(string|\\Stringable $message, array $context = []): void\n    {\n        $this->log(LogLevel::INFO, $message, $context);\n    }\n\n    /**\n     * Detailed debug information.\n     */\n    public function debug(string|\\Stringable $message, array $context = []): void\n    {\n        $this->log(LogLevel::DEBUG, $message, $context);\n    }\n\n    /**\n     * Logs with an arbitrary level.\n     *\n     * @param mixed $level\n     *\n     * @throws \\Psr\\Log\\InvalidArgumentException\n     */\n    abstract public function log($level, string|\\Stringable $message, array $context = []): void;\n}\n"
  },
  {
    "path": "src/NullLogger.php",
    "content": "<?php\n\nnamespace Psr\\Log;\n\n/**\n * This Logger can be used to avoid conditional log calls.\n *\n * Logging should always be optional, and if no logger is provided to your\n * library creating a NullLogger instance to have something to throw logs at\n * is a good way to avoid littering your code with `if ($this->logger) { }`\n * blocks.\n */\nclass NullLogger extends AbstractLogger\n{\n    /**\n     * Logs with an arbitrary level.\n     *\n     * @param mixed[] $context\n     *\n     * @throws \\Psr\\Log\\InvalidArgumentException\n     */\n    public function log($level, string|\\Stringable $message, array $context = []): void\n    {\n        // noop\n    }\n}\n"
  }
]