#include "base/debug/debugger.h"
#include "base/debug/dump_without_crashing.h"
#include "base/environment.h"
-#include "base/file_util.h"
#include "base/files/file_path.h"
+#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
void SilentRuntimeAssertHandler(const std::string& str) {
base::debug::BreakDebugger();
}
-void SilentRuntimeReportHandler(const std::string& str) {
-}
-#if defined(OS_WIN)
-// Handler to silently dump the current process when there is an assert in
-// chrome.
-void DumpProcessAssertHandler(const std::string& str) {
- base::debug::DumpWithoutCrashing();
-}
-#endif // OS_WIN
MSVC_ENABLE_OPTIMIZE();
// Suppresses error/assertion dialogs and enables the logging of
return;
logging::SetLogAssertHandler(SilentRuntimeAssertHandler);
- logging::SetLogReportHandler(SilentRuntimeReportHandler);
#if defined(OS_WIN)
UINT new_flags = SEM_FAILCRITICALERRORS |
} // anonymous namespace
-base::FilePath GetSessionLogFile(const CommandLine& command_line) {
+base::FilePath GetSessionLogDir(const CommandLine& command_line) {
base::FilePath log_dir;
std::string log_dir_str;
scoped_ptr<base::Environment> env(base::Environment::Create());
}
log_dir = log_dir.Append(profile_dir);
}
- return log_dir.Append(GetLogFileName().BaseName());
+ return log_dir;
+}
+
+base::FilePath GetSessionLogFile(const CommandLine& command_line) {
+ return GetSessionLogDir(command_line).Append(GetLogFileName().BaseName());
}
void RedirectChromeLogging(const CommandLine& command_line) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles) &&
- chrome_logging_redirected_) {
+ if (chrome_logging_redirected_) {
// TODO(nkostylev): Support multiple active users. http://crbug.com/230345
- LOG(ERROR) << "NOT redirecting logging for multi-profiles case.";
+ LOG(WARNING) << "NOT redirecting logging for multi-profiles case.";
return;
}
logging::LogEventProvider::Initialize(kChromeTraceProviderName);
#endif
-#if DCHECK_IS_ON && defined(NDEBUG) && defined(OS_WIN)
- if (command_line.HasSwitch(switches::kSilentDumpOnDCHECK))
- logging::SetLogReportHandler(DumpProcessAssertHandler);
-#endif
-
chrome_logging_initialized_ = true;
}