diff --git a/composer.json b/composer.json index c3f86e8..6615990 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,8 @@ } ], "require": { - "php": ">=5.3.0" + "php": ">=5.3.0", + "psr/log": "^1.1" }, "require-dev": { "phpunit/phpunit": "~4.3", diff --git a/src/FluentLogger.php b/src/FluentLogger.php index 7c1176e..d686162 100644 --- a/src/FluentLogger.php +++ b/src/FluentLogger.php @@ -18,6 +18,8 @@ */ namespace Fluent\Logger; +use Psr\Log\LogLevel; + /** * Fluent Logger * @@ -516,4 +518,49 @@ public function getOption($key, $default = null) return $result; } + + public function emergency($message, array $context = array()) + { + return $this->post($message, array_merge(array('level' => LogLevel::EMERGENCY), $context)); + } + + public function alert($message, array $context = array()) + { + return $this->post($message, array_merge(array('level' => LogLevel::ALERT), $context)); + } + + public function critical($message, array $context = array()) + { + return $this->post($message, array_merge(array('level' => LogLevel::CRITICAL), $context)); + } + + public function error($message, array $context = array()) + { + return $this->post($message, array_merge(array('level' => LogLevel::ERROR), $context)); + } + + public function warning($message, array $context = array()) + { + return $this->post($message, array_merge(array('level' => LogLevel::WARNING), $context)); + } + + public function notice($message, array $context = array()) + { + return $this->post($message, array_merge(array('level' => LogLevel::NOTICE), $context)); + } + + public function info($message, array $context = array()) + { + return $this->post($message, array_merge(array('level' => LogLevel::INFO), $context)); + } + + public function debug($message, array $context = array()) + { + return $this->post($message, array_merge(array('level' => LogLevel::DEBUG), $context)); + } + + public function log($level, $message, array $context = array()) + { + return $this->post($message, array_merge(array('level' => $level), $context)); + } } diff --git a/src/LoggerInterface.php b/src/LoggerInterface.php index 1425a83..efbb382 100644 --- a/src/LoggerInterface.php +++ b/src/LoggerInterface.php @@ -18,7 +18,7 @@ */ namespace Fluent\Logger; -interface LoggerInterface +interface LoggerInterface extends \Psr\Log\LoggerInterface { /** * @abstract