summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/net_log_logger.cc
blob: 14bac0ba6f95a4e06e5e3c64e03655cffbba55fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/net/net_log_logger.h"

#include "base/json/json_writer.h"

NetLogLogger::NetLogLogger() {}

NetLogLogger::~NetLogLogger() {}

void NetLogLogger::OnAddEntry(net::NetLog::EventType type,
                              const base::TimeTicks& time,
                              const net::NetLog::Source& source,
                              net::NetLog::EventPhase phase,
                              net::NetLog::EventParameters* params) {
  scoped_ptr<Value> value(net::NetLog::EntryToDictionaryValue(type, time,
                                                              source, phase,
                                                              params, true));
  std::string json;
  base::JSONWriter::Write(value.get(), true, &json);
  LOG(INFO) << json;
}