Commit 3c948737 authored by 王源's avatar 王源
Browse files

Merge branch 'feature/exception' into test

parents db49cc05 f629c898
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -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];
                    }
                    }