#feature: update log format
This commit is contained in:
@@ -25,11 +25,11 @@ class GitMonitorCheckCommand extends Command
|
||||
|
||||
foreach ($results as $repo => $result) {
|
||||
if (isset($result['error'])) {
|
||||
Log::error(sprintf('[%s] %s', $repo, $result['error']));
|
||||
Log::channel('git-monitor')->error(sprintf('[%s] %s', $repo, $result['error']));
|
||||
continue;
|
||||
}
|
||||
|
||||
Log::info(sprintf(
|
||||
Log::channel('git-monitor')->info(sprintf(
|
||||
'[%s] 分支 %s 已对齐 %s,扫描 %d 个提交。',
|
||||
$repo,
|
||||
$result['branch'],
|
||||
@@ -38,9 +38,9 @@ class GitMonitorCheckCommand extends Command
|
||||
));
|
||||
|
||||
if (!empty($result['issues']['develop_merges'])) {
|
||||
Log::warning(sprintf(' - 检测到 %d 个 develop merge:', count($result['issues']['develop_merges'])));
|
||||
Log::channel('git-monitor')->warning(sprintf(' - 检测到 %d 个 develop merge:', count($result['issues']['develop_merges'])));
|
||||
foreach ($result['issues']['develop_merges'] as $commit) {
|
||||
Log::warning(sprintf(
|
||||
Log::channel('git-monitor')->warning(sprintf(
|
||||
' • %s %s (%s)',
|
||||
substr($commit['hash'], 0, 8),
|
||||
$commit['subject'],
|
||||
@@ -50,9 +50,9 @@ class GitMonitorCheckCommand extends Command
|
||||
}
|
||||
|
||||
if (!empty($result['issues']['missing_functions'])) {
|
||||
Log::warning(sprintf(' - 检测到 %d 个疑似缺失函数的提交:', count($result['issues']['missing_functions'])));
|
||||
Log::channel('git-monitor')->warning(sprintf(' - 检测到 %d 个疑似缺失函数的提交:', count($result['issues']['missing_functions'])));
|
||||
foreach ($result['issues']['missing_functions'] as $issue) {
|
||||
Log::warning(sprintf(
|
||||
Log::channel('git-monitor')->warning(sprintf(
|
||||
' • %s %s (%s)',
|
||||
substr($issue['commit']['hash'], 0, 8),
|
||||
$issue['commit']['subject'],
|
||||
@@ -60,7 +60,7 @@ class GitMonitorCheckCommand extends Command
|
||||
));
|
||||
foreach ($issue['details'] as $detail) {
|
||||
$functions = implode(', ', array_slice($detail['functions'], 0, 5));
|
||||
Log::warning(sprintf(' %s => %s', $detail['file'], $functions));
|
||||
Log::channel('git-monitor')->warning(sprintf(' %s => %s', $detail['file'], $functions));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user