Injects Git branch and Git commit SHA in all records.
More...
Injects Git branch and Git commit SHA in all records.
- Author
- Nick Otter
-
Jordi Boggiano j.bog.nosp@m.gian.nosp@m.o@sel.nosp@m.d.be
Definition at line 22 of file GitProcessor.php.
◆ __construct()
Monolog\Processor\GitProcessor::__construct |
( |
|
$level = Logger::DEBUG | ) |
|
◆ __invoke()
Monolog\Processor\GitProcessor::__invoke |
( |
array |
$record | ) |
|
- Parameters
-
- Returns
- array
Definition at line 36 of file GitProcessor.php.
39 if ($record[
'level'] < $this->level) {
43 $record[
'extra'][
'git'] = self::getGitInfo();
◆ getGitInfo()
static Monolog\Processor\GitProcessor::getGitInfo |
( |
| ) |
|
|
staticprivate |
Definition at line 48 of file GitProcessor.php.
References array.
54 $branches = `git branch -v --no-abbrev`;
55 if (preg_match(
'{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) {
56 return self::$cache =
array(
57 'branch' => $matches[1],
58 'commit' => $matches[2],
62 return self::$cache =
array();
Create styles array
The data for the language used.
◆ $cache
Monolog\Processor\GitProcessor::$cache |
|
staticprivate |
◆ $level
Monolog\Processor\GitProcessor::$level |
|
private |
The documentation for this class was generated from the following file: