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

Side by Side Diff: chrome/test/chromedriver/logging.cc

Issue 14263024: Logging API in chromedriver2. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « chrome/test/chromedriver/logging.h ('k') | chrome/test/chromedriver/logging_unittest.cc » ('j') | 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) 2012 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/chromedriver/logging.h"
6
7 #include "chrome/test/chromedriver/capabilities.h"
8 #include "chrome/test/chromedriver/chrome/devtools_event_logger.h"
9 #include "chrome/test/chromedriver/chrome/status.h"
10
11 Status CreateLoggers(const Capabilities& capabilities,
12 ScopedVector<DevToolsEventLogger>* out_loggers) {
13 if (capabilities.logging_prefs) {
14 ScopedVector<DevToolsEventLogger> loggers;
15 for (DictionaryValue::Iterator pref(*capabilities.logging_prefs);
16 !pref.IsAtEnd(); pref.Advance()) {
17 const std::string type = pref.key();
18 std::string level;
19 if (!pref.value().GetAsString(&level)) {
20 return Status(kUnknownError,
21 "logging level must be a string for log type: " + type);
22 }
23 if ("profiler" == type) {
24 std::vector<std::string> domains;
25 domains.push_back("Network");
26 domains.push_back("Page");
27 domains.push_back("Timeline");
28 loggers.push_back(new DevToolsEventLogger(type, domains, level));
29 } else {
30 return Status(kUnknownError, "unsupported log type: " + type);
31 }
32 // TODO(klm): Implement and add here the console logger.
33 }
34 out_loggers->swap(loggers);
35 }
36 return Status(kOk);
37 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/logging.h ('k') | chrome/test/chromedriver/logging_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698