-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Creating a array that content all the patterns used in the class, this allow if in the feature we want to create a new featured that include patterns we cant add this for a best readeability (some patterns get really complicated * Modifying all the sugestion from rap2hpoutre in the PR comments
- Loading branch information
1 parent
4502f4e
commit b0a7055
Showing
2 changed files
with
45 additions
and
7 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
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,34 @@ | ||
<?php | ||
|
||
namespace Rap2hpoutre\LaravelLogViewer; | ||
|
||
/** | ||
* Class Pattern | ||
* @property array patterns | ||
* @package Rap2hpoutre\LaravelLogViewer | ||
*/ | ||
|
||
class Pattern | ||
{ | ||
|
||
/** | ||
* @var array | ||
*/ | ||
private static $patterns = [ | ||
'logs' => '/\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}([\+-]\d{4})?\].*/', | ||
'current_log' => [ | ||
'/^\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}([\+-]\d{4})?)\](?:.*?(\w+)\.|.*?)', | ||
': (.*?)( in .*?:[0-9]+)?$/i' | ||
], | ||
'files' => '/\{.*?\,.*?\}/i', | ||
]; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function all() | ||
{ | ||
return array_keys($this->patterns); | ||
} | ||
|
||
} |