Merge pull request #10911 from electron/fix_window_log_folder
🔧 Fix windows app log path
This commit is contained in:
commit
52cbec2438
1 changed files with 6 additions and 10 deletions
|
@ -166,16 +166,12 @@ BrowserMainParts::~BrowserMainParts() {
|
||||||
|
|
||||||
#if defined(OS_WIN) || defined(OS_LINUX)
|
#if defined(OS_WIN) || defined(OS_LINUX)
|
||||||
void OverrideAppLogsPath() {
|
void OverrideAppLogsPath() {
|
||||||
#if defined(OS_WIN)
|
base::FilePath path;
|
||||||
std::wstring app_name = base::UTF8ToWide(GetApplicationName());
|
if (PathService::Get(brightray::DIR_APP_DATA, &path)) {
|
||||||
std::wstring log_path = L"%HOMEDRIVE%%HOMEPATH%\\AppData\\Roaming\\";
|
path = path.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));
|
||||||
std::wstring app_log_path = log_path + app_name + L"\\logs";
|
path = path.Append(base::FilePath::FromUTF8Unsafe("logs"));
|
||||||
#else
|
PathService::Override(DIR_APP_LOGS, path);
|
||||||
std::string app_name = GetApplicationName();
|
}
|
||||||
std::string home_path = std::string(getenv("HOME"));
|
|
||||||
std::string app_log_path = home_path + "/.config/" + app_name + "/logs";
|
|
||||||
#endif
|
|
||||||
PathService::Override(DIR_APP_LOGS, base::FilePath(app_log_path));
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue