| 234 | #endif |
| 235 | |
| 236 | PathString GetDefaultLogFile() { |
| 237 | #if defined(OS_WIN) |
| 238 | // On Windows we use the same path as the exe. |
| 239 | wchar_t module_name[MAX_PATH]; |
| 240 | GetModuleFileName(NULL, module_name, MAX_PATH); |
| 241 | |
| 242 | PathString log_file = module_name; |
| 243 | PathString::size_type last_backslash = |
| 244 | log_file.rfind('\\', log_file.size()); |
| 245 | if (last_backslash != PathString::npos) |
| 246 | log_file.erase(last_backslash + 1); |
| 247 | log_file += L"debug.log"; |
| 248 | return log_file; |
| 249 | #elif defined(OS_LINUX) |
| 250 | return GetProcessName() + ".log"; |
| 251 | #elif defined(OS_POSIX) |
| 252 | // On other platforms we just use the current directory. |
| 253 | return PathString("debug.log"); |
| 254 | #endif |
| 255 | } |
| 256 | |
| 257 | // This class acts as a wrapper for locking the logging files. |
| 258 | // LoggingLock::Init() should be called from the main thread before any logging |
no test coverage detected