Loading src/Amqp/Producer/ExceptionLogProducer.php +4 −0 Original line number Original line Diff line number Diff line Loading @@ -24,11 +24,15 @@ class ExceptionLogProducer extends ProducerMessage put_log('获取操作人失败; ' . $e->getMessage(), 'ExceptionLogProducer.log'); put_log('获取操作人失败; ' . $e->getMessage(), 'ExceptionLogProducer.log'); } } // 排除依赖包文件和运行缓存文件 // 排除依赖包文件和运行缓存文件 put_log("file: {$data['file']}", 'ExceptionLogProducerEcho.log'); if (strpos($data['file'], '/vendor/') === false && strpos($data['file'], '/runtime/') === false) { if (strpos($data['file'], '/vendor/') === false && strpos($data['file'], '/runtime/') === false) { try { try { put_log("git: git blame -L {$data['line']},{$data['line']} {$data['file']}", 'ExceptionLogProducerEcho.log'); exec("git blame -L {$data['line']},{$data['line']} {$data['file']}", $output); exec("git blame -L {$data['line']},{$data['line']} {$data['file']}", $output); put_log("output: $output", 'ExceptionLogProducerEcho.log'); if (!empty($output[0]) && is_string($output[0])) { if (!empty($output[0]) && is_string($output[0])) { preg_match('/(?<=\()[^ ]+/', $output[0], $matches); preg_match('/(?<=\()[^ ]+/', $output[0], $matches); put_log("matches: $matches", 'ExceptionLogProducerEcho.log'); if (!empty($matches[0])) { if (!empty($matches[0])) { $data['coder'] = $matches[0]; $data['coder'] = $matches[0]; } } Loading Loading
src/Amqp/Producer/ExceptionLogProducer.php +4 −0 Original line number Original line Diff line number Diff line Loading @@ -24,11 +24,15 @@ class ExceptionLogProducer extends ProducerMessage put_log('获取操作人失败; ' . $e->getMessage(), 'ExceptionLogProducer.log'); put_log('获取操作人失败; ' . $e->getMessage(), 'ExceptionLogProducer.log'); } } // 排除依赖包文件和运行缓存文件 // 排除依赖包文件和运行缓存文件 put_log("file: {$data['file']}", 'ExceptionLogProducerEcho.log'); if (strpos($data['file'], '/vendor/') === false && strpos($data['file'], '/runtime/') === false) { if (strpos($data['file'], '/vendor/') === false && strpos($data['file'], '/runtime/') === false) { try { try { put_log("git: git blame -L {$data['line']},{$data['line']} {$data['file']}", 'ExceptionLogProducerEcho.log'); exec("git blame -L {$data['line']},{$data['line']} {$data['file']}", $output); exec("git blame -L {$data['line']},{$data['line']} {$data['file']}", $output); put_log("output: $output", 'ExceptionLogProducerEcho.log'); if (!empty($output[0]) && is_string($output[0])) { if (!empty($output[0]) && is_string($output[0])) { preg_match('/(?<=\()[^ ]+/', $output[0], $matches); preg_match('/(?<=\()[^ ]+/', $output[0], $matches); put_log("matches: $matches", 'ExceptionLogProducerEcho.log'); if (!empty($matches[0])) { if (!empty($matches[0])) { $data['coder'] = $matches[0]; $data['coder'] = $matches[0]; } } Loading