35 #include <boost/filesystem.hpp>
37 namespace fs = boost::filesystem;
54 std::string log_file_name;
55 M_string::const_iterator it = remappings.find(
"__log");
56 if (it != remappings.end())
58 log_file_name = it->second;
64 if (log_file_name.empty())
69 std::string ros_log_env;
72 log_file_name = ros_log_env + std::string(
"/");
78 log_file_name = ros_log_env + std::string(
"/log/");
85 std::string dotros = ros_log_env + std::string(
"/.ros/");
86 fs::create_directory(dotros);
87 log_file_name = dotros +
"log/";
88 fs::create_directory(log_file_name);
107 std::snprintf(pid_str,
sizeof(pid_str),
"%d", pid);
108 log_file_name += std::string(
"_") + std::string(pid_str) + std::string(
".log");
111 log_file_name = fs::system_complete(log_file_name).string();