File tree 1 file changed +18
-17
lines changed
1 file changed +18
-17
lines changed Original file line number Diff line number Diff line change 97
97
#define LOG_TEE_TARGET stderr
98
98
#endif
99
99
100
+ // NOTE: currently disabled as it produces too many log files
100
101
// Utility to obtain "pid" like unique process id and use it when creating log files.
101
- inline std::string log_get_pid ()
102
- {
103
- static std::string pid;
104
- if (pid.empty ())
105
- {
106
- // std::this_thread::get_id() is the most portable way of obtaining a "process id"
107
- // it's not the same as "pid" but is unique enough to solve multiple instances
108
- // trying to write to the same log.
109
- std::stringstream ss;
110
- ss << std::this_thread::get_id ();
111
- pid = ss.str ();
112
- }
113
-
114
- return pid;
115
- }
102
+ // inline std::string log_get_pid()
103
+ // {
104
+ // static std::string pid;
105
+ // if (pid.empty())
106
+ // {
107
+ // // std::this_thread::get_id() is the most portable way of obtaining a "process id"
108
+ // // it's not the same as "pid" but is unique enough to solve multiple instances
109
+ // // trying to write to the same log.
110
+ // std::stringstream ss;
111
+ // ss << std::this_thread::get_id();
112
+ // pid = ss.str();
113
+ // }
114
+ //
115
+ // return pid;
116
+ // }
116
117
117
118
// Utility function for generating log file names with unique id based on thread id.
118
119
// invocation with log_filename_generator( "llama", "log" ) creates a string "llama.<number>.log"
@@ -126,8 +127,8 @@ inline std::string log_filename_generator_impl(const std::string & log_file_base
126
127
std::stringstream buf;
127
128
128
129
buf << log_file_basename;
129
- buf << " ." ;
130
- buf << log_get_pid ();
130
+ // buf << ".";
131
+ // buf << log_get_pid();
131
132
buf << " ." ;
132
133
buf << log_file_extension;
133
134
You can’t perform that action at this time.
0 commit comments