Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: chrome/test/webdriver/webdriver_logging.cc

Issue 7104085: In chromedriver, add /log handler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/webdriver/webdriver_logging.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/test/webdriver/webdriver_logging.h"
6
7 #include "base/file_path.h"
8 #include "base/file_util.h"
9 #include "base/logging.h"
10
11 namespace {
12
13 // Path to the WebDriver log file.
14 const FilePath::CharType kLogPath[] = FILE_PATH_LITERAL("chromedriver.log");
15
16 } // namespace
17
18 namespace webdriver {
19
20 void InitWebDriverLogging(int min_log_level) {
21 bool success = InitLogging(
22 kLogPath,
23 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG,
24 logging::LOCK_LOG_FILE,
25 logging::DELETE_OLD_LOG_FILE,
26 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
27 if (!success) {
28 PLOG(ERROR) << "Unable to initialize logging";
29 }
30 logging::SetLogItems(false, // enable_process_id
31 false, // enable_thread_id
32 true, // enable_timestamp
33 false); // enable_tickcount
34 logging::SetMinLogLevel(min_log_level);
35 }
36
37 bool GetLogContents(std::string* log_contents) {
38 return file_util::ReadFileToString(FilePath(kLogPath), log_contents);
39 }
40
41 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/webdriver_logging.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698