#include #include "event_log.h" #include #include #include #include #include #include #include #include void CEventLog::Start() { if(access("./log/",F_OK)!=0) { int status = mkdir("./log/", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); if (status == 0) { std::cout << "文件夹创建成功!" << std::endl; } else { std::cout << "文件夹创建失败!" << std::endl; } } std::stringstream oss; oss<<"./log/"< l(_mutex); type=_type; steer=_steer; accel=_accel; brake=_brake; } if(type!=EventType::NORMAL) { std::string s; switch(_type) { case EventType::EMERGENCY: s= "碰撞临界:"; break; case EventType::OFFLINE: s="车辆掉线:"; break; case EventType::LOW_RPM: s="车辆熄火:"; break; }; std::stringstream oss; oss< l(_mutex); _type=type; _steer=steer; _accel=accel; _brake=brake; }