截图失败时,返回ffmpeg日志; ffmpeg命令支持相对路径

This commit is contained in:
ziyue
2022-02-24 11:28:48 +08:00
parent a3d696d805
commit 63f22ee6f2
5 changed files with 46 additions and 25 deletions

View File

@@ -30,7 +30,7 @@
using namespace toolkit;
using namespace std;
void Process::run(const string &cmd, const string &log_file_tmp) {
void Process::run(const string &cmd, string &log_file_tmp) {
kill(2000);
#ifdef _WIN32
STARTUPINFO si = {0};
@@ -42,6 +42,7 @@ void Process::run(const string &cmd, const string &log_file_tmp) {
} else {
log_file = StrPrinter << log_file_tmp << "." << getCurrentMillisecond();
}
log_file_tmp = log_file;
//重定向shell日志至文件
auto fp = File::create_file(log_file.data(), "ab");
@@ -92,6 +93,8 @@ void Process::run(const string &cmd, const string &log_file_tmp) {
//在启动子进程时暂时禁用SIGINT、SIGTERM信号
signal(SIGINT, SIG_IGN);
signal(SIGTERM, SIG_IGN);
signal(SIGSEGV, SIG_IGN);
signal(SIGABRT, SIG_IGN);
//重定向shell日志至文件
auto fp = File::create_file(log_file.data(), "ab");
@@ -148,6 +151,7 @@ void Process::run(const string &cmd, const string &log_file_tmp) {
} else {
log_file = StrPrinter << log_file_tmp << "." << _pid;
}
log_file_tmp = log_file;
InfoL << "start child process " << _pid << ", log file:" << log_file;
#endif // _WIN32
}