StandardLogger |
|
---|---|
|
|
This file is part of the Pinocchio library. (c) José Nahuel Cuesta Luengo nahuelcuestaluengo@gmail.com For the full copyright and license information, please view the LICENSE file that was distributed with this source code. |
namespace Pinocchio\Logger;
use \Clinner\ValueHolder;
|
StandardLogger @author José Nahuel Cuesta Luengo nahuelcuestaluengo@gmail.com |
class StandardLogger implements LoggerInterface
{
|
Options for the logger. @var |
private $options;
private $stdout;
private $stderr;
|
Constructor. @param |
public function __construct($options = array())
{
$this->options = new ValueHolder($options);
$this->stdout = fopen('php://stdout', 'w+');
$this->stderr = fopen('php://stderr', 'w+');
}
|
Log an info message. @param @return |
public function log($message)
{
fputs($this->stdout, $message);
return $this;
}
|
Log an error message. @param @return |
public function error($message)
{
fputs($this->stderr, $message);
return $this;
}
}
|