This repository has been archived by the owner on Jul 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logger support in SignaturDecipher, Format and VideoInfo
- Loading branch information
Showing
11 changed files
with
280 additions
and
65 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 |
---|---|---|
|
@@ -2,6 +2,5 @@ cache/* | |
composer.phar | ||
composer.lock | ||
config/custom.php | ||
Deciphers.log | ||
logs/* | ||
vendor |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace YoutubeDownloader\Logger\Handler; | ||
|
||
/** | ||
* a handler instance that handles no entries | ||
*/ | ||
class NullHandler implements Handler | ||
{ | ||
/** | ||
* Check if this handler handels a log level | ||
* | ||
* @param string $level A valid log level from LogLevel class | ||
* @return boolean | ||
*/ | ||
public function handles($level) | ||
{ | ||
return false; | ||
} | ||
|
||
/** | ||
* Handle an entry | ||
* | ||
* @param Entry $entry | ||
* @return boolean | ||
*/ | ||
public function handle(Entry $entry) | ||
{ | ||
return false; | ||
} | ||
} |
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,40 @@ | ||
<?php | ||
|
||
namespace YoutubeDownloader\Logger; | ||
|
||
/** | ||
* Trait for logger-aware instances | ||
*/ | ||
trait LoggerAwareTrait | ||
{ | ||
/** | ||
* @var YoutubeDownloader\Logger\Logger | ||
*/ | ||
protected $logger; | ||
|
||
/** | ||
* Sets a logger instance on the object | ||
* | ||
* @param Logger $logger | ||
* @return null | ||
*/ | ||
public function setLogger(Logger $logger) | ||
{ | ||
$this->logger = $logger; | ||
} | ||
|
||
/** | ||
* Gets a logger instance | ||
* | ||
* @return Logger | ||
*/ | ||
public function getLogger() | ||
{ | ||
if ( $this->logger === null ) | ||
{ | ||
$this->logger = new NullLogger; | ||
} | ||
|
||
return $this->logger; | ||
} | ||
} |
Oops, something went wrong.