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

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
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
kkania 2013/04/18 20:27:55 remove newline
klm 2013/04/18 22:53:34 Done.
12 Status CreateLoggers(const Capabilities& capabilities,
13 ScopedVector<DevToolsEventLogger>* out_loggers) {
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 ("performance" == type) {
kkania 2013/04/18 20:27:55 i notice the java client has a "profiling" type; d
klm 2013/04/18 22:53:34 Done. Meant to look that up and never did, thanks:
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 return Status(kOk);
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698