-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
187 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
composer.lock | ||
vendor | ||
phpunit.xml | ||
phpunit.xml | ||
phpstan.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace flotzilla\Logger\Channel; | ||
|
||
use flotzilla\Logger\Handler\HandlerInterface; | ||
use flotzilla\Logger\LogLevel\LogLevel; | ||
|
||
class NullChannel implements ChannelInterface | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public function setHandlers(array $handlers): void | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getHandlers(): array | ||
{ | ||
return []; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function addHandler(HandlerInterface $handler, string $handlerName = null) | ||
{ | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getChannelName(): string | ||
{ | ||
return 'NullChannel'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function handle(string $message = '', array $context = [], string $level = LogLevel::DEBUG, string $date = '') | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace flotzilla\Logger\Exception; | ||
|
||
use Throwable; | ||
|
||
class InvalidChannelNameException extends \Exception | ||
{ | ||
/** @var string $message */ | ||
protected $message = 'Channel name is invalid'; | ||
|
||
/** | ||
* InvalidLogLevelException constructor. | ||
* @param string $message | ||
* @param int $code | ||
* @param Throwable|null $previous | ||
*/ | ||
public function __construct($message = '', $code = 0, Throwable $previous = null) | ||
{ | ||
$message = $message ?: $this->message; | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters