From f026bbb454e5d46b0e1c1c24001ff8211e1fc68d Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 7 Aug 2017 13:22:10 -0700 Subject: [PATCH] add first go at linux log path override --- brightray/browser/browser_main_parts.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index a949a236f3..18ddb2f771 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -89,6 +89,18 @@ void OverrideLinuxAppDataPath() { PathService::Override(DIR_APP_DATA, path); } +// void OverrideWinAppLogsPath() { +// base::FilePath path; +// // should be in c:\program files\myapp\logs ? +// PathService::Override(DIR_APP_DATA, path); +// } + +void OverrideLinuxAppLogsPath() { + std::string appName = GetExecutableFileProductName(); + std::string logPath = '/var/log' + appName + PathService::Override(DIR_APP_DATA, base::FilePath(logPath)); +} + int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) { if (!g_in_x11_io_error_handler) { base::ThreadTaskRunnerHandle::Get()->PostTask( @@ -165,6 +177,12 @@ void BrowserMainParts::PreEarlyInitialization() { #if defined(OS_MACOSX) OverrideMacAppLogsPath(); #endif +#if defined(OS_LINUX) + OverrideLinuxAppLogsPath(); +#endif +// #if defined(OS_WIN) +// OverrideWinAppLogsPath(); +// #endif #if defined(USE_X11) views::LinuxUI::SetInstance(BuildGtkUi()); OverrideLinuxAppDataPath();