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

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

Issue 2743013002: Add webdriver endpoint to send custom debugger commands (Closed)
Patch Set: New DevToolsEventsLogger Created 3 years, 9 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 2014 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/base_logger.h"
6
7 #include <string>
8
9 #include "base/json/json_writer.h"
10 #include "base/values.h"
11 #include "chrome/test/chromedriver/chrome/log.h"
12
13 BaseLogger::BaseLogger(Log* log)
14 : log_(log) {}
15
16 void BaseLogger::AddLogEntry(
samuong 2017/03/27 18:42:10 I'm not sure this should be a separate base class.
17 Log::Level level,
18 const std::string& webview,
19 const std::string& method,
20 const base::DictionaryValue& params) {
21 base::DictionaryValue log_message_dict;
22 log_message_dict.SetString("webview", webview);
23 log_message_dict.SetString("message.method", method);
24 log_message_dict.Set("message.params", params.DeepCopy());
25 std::string log_message_json;
26 base::JSONWriter::Write(log_message_dict, &log_message_json);
27
28 // TODO(klm): extract timestamp from params?
29 // Look at where it is for Page, Network, Timeline, and trace events.
30 log_->AddEntry(level, log_message_json);
31 }
32
33 void BaseLogger::AddLogEntry(
34 const std::string& webview,
35 const std::string& method,
36 const base::DictionaryValue& params) {
37 AddLogEntry(Log::kInfo, webview, method, params);
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698