From 9319035b01befc8d59c9c1c7f9d83fbe15b0ba79 Mon Sep 17 00:00:00 2001 From: "mmenke@chromium.org" Date: Fri, 13 Aug 2010 13:55:10 +0000 Subject: Redirects NetLog output to the log file, when the command line option "--log-net-log" is used. BUG= 50987 TEST= Run "chrome --log-net-log --enable-logging --log-level=0" And then check to make sure the log contains the NetLog events. Review URL: http://codereview.chromium.org/3040051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56021 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/net/net_log_logger.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 chrome/browser/net/net_log_logger.h (limited to 'chrome/browser/net/net_log_logger.h') diff --git a/chrome/browser/net/net_log_logger.h b/chrome/browser/net/net_log_logger.h new file mode 100644 index 0000000..98c989e --- /dev/null +++ b/chrome/browser/net/net_log_logger.h @@ -0,0 +1,31 @@ +// 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. + +#ifndef CHROME_BROWSER_NET_NET_LOG_LOGGER_H_ +#define CHROME_BROWSER_NET_NET_LOG_LOGGER_H_ +#pragma once + +#include "chrome/browser/net/chrome_net_log.h" + +// NetLogLogger watches the NetLog event stream, and sends all entries to +// LOG(INFO). This is to debug errors that prevent getting to the +// about:net-internals page. +class NetLogLogger : public ChromeNetLog::Observer { + public: + NetLogLogger(); + ~NetLogLogger(); + + // Observer implementation: + virtual void OnAddEntry(net::NetLog::EventType type, + const base::TimeTicks& time, + const net::NetLog::Source& source, + net::NetLog::EventPhase phase, + net::NetLog::EventParameters* params); + + private: + DISALLOW_COPY_AND_ASSIGN(NetLogLogger); +}; + +#endif // CHROME_BROWSER_NET_NET_LOG_LOGGER_H_ + -- cgit v1.1