diff options
author | garykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-07 23:05:01 +0000 |
---|---|---|
committer | garykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-07 23:05:01 +0000 |
commit | 9a37fdf2a4314bf49c003a8f126f06751ba1ba55 (patch) | |
tree | 4659ba663a7c6eeaf125b63db2311f0787a78a34 /remoting/client | |
parent | 02712128820af52b4ed31830fe950d64102cf954 (diff) | |
download | chromium_src-9a37fdf2a4314bf49c003a8f126f06751ba1ba55.zip chromium_src-9a37fdf2a4314bf49c003a8f126f06751ba1ba55.tar.gz chromium_src-9a37fdf2a4314bf49c003a8f126f06751ba1ba55.tar.bz2 |
Conenct Chromoting plugin debug log to JS UI.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7262015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r-- | remoting/client/chromoting_client.cc | 4 | ||||
-rw-r--r-- | remoting/client/chromoting_client.h | 6 | ||||
-rw-r--r-- | remoting/client/client_logger.cc | 46 | ||||
-rw-r--r-- | remoting/client/client_logger.h | 31 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_client_logger.cc | 4 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_client_logger.h | 6 |
6 files changed, 8 insertions, 89 deletions
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc index d7eee8e..ff926a2 100644 --- a/remoting/client/chromoting_client.cc +++ b/remoting/client/chromoting_client.cc @@ -6,10 +6,10 @@ #include "base/bind.h" #include "base/message_loop.h" +#include "remoting/base/logger.h" #include "remoting/base/tracer.h" #include "remoting/client/chromoting_view.h" #include "remoting/client/client_context.h" -#include "remoting/client/client_logger.h" #include "remoting/client/input_handler.h" #include "remoting/client/rectangle_update_decoder.h" #include "remoting/protocol/connection_to_host.h" @@ -23,7 +23,7 @@ ChromotingClient::ChromotingClient(const ClientConfig& config, ChromotingView* view, RectangleUpdateDecoder* rectangle_decoder, InputHandler* input_handler, - ClientLogger* logger, + Logger* logger, Task* client_done) : config_(config), context_(context), diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h index 67bda81..94091f1 100644 --- a/remoting/client/chromoting_client.h +++ b/remoting/client/chromoting_client.h @@ -30,8 +30,8 @@ class NotifyResolutionRequest; } // namespace protocol class ClientContext; -class ClientLogger; class InputHandler; +class Logger; class RectangleUpdateDecoder; // TODO(sergeyu): Move VideoStub implementation to RectangleUpdateDecoder. @@ -46,7 +46,7 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, ChromotingView* view, RectangleUpdateDecoder* rectangle_decoder, InputHandler* input_handler, - ClientLogger* logger, + Logger* logger, Task* client_done); virtual ~ChromotingClient(); @@ -118,7 +118,7 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, ChromotingView* view_; RectangleUpdateDecoder* rectangle_decoder_; InputHandler* input_handler_; - ClientLogger* logger_; + Logger* logger_; // If non-NULL, this is called when the client is done. Task* client_done_; diff --git a/remoting/client/client_logger.cc b/remoting/client/client_logger.cc deleted file mode 100644 index b970697..0000000 --- a/remoting/client/client_logger.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2011 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 "remoting/client/client_logger.h" - -#include <stdarg.h> // va_list - -#include "base/stringprintf.h" - -namespace remoting { - -ClientLogger::ClientLogger() { -} - -ClientLogger::~ClientLogger() { -} - -void ClientLogger::Log(logging::LogSeverity severity, const char* format, ...) { - va_list ap; - va_start(ap, format); - va_Log(severity, format, ap); - va_end(ap); -} - -void ClientLogger::VLog(int verboselevel, const char* format, ...) { - va_list ap; - va_start(ap, format); - va_VLog(verboselevel, format, ap); - va_end(ap); -} - -void ClientLogger::va_Log(logging::LogSeverity severity, - const char* format, va_list ap) { - std::string message; - base::StringAppendV(&message, format, ap); - logging::LogMessage(__FILE__, __LINE__, severity).stream() << message; -} - -void ClientLogger::va_VLog(int verboselevel, const char* format, va_list ap) { - std::string message; - base::StringAppendV(&message, format, ap); - VLOG(verboselevel) << message; -} - -} // namespace remoting diff --git a/remoting/client/client_logger.h b/remoting/client/client_logger.h deleted file mode 100644 index f481c51..0000000 --- a/remoting/client/client_logger.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2011 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 REMOTING_CLIENT_CLIENT_LOGGER_H_ -#define REMOTING_CLIENT_CLIENT_LOGGER_H_ - -#include "base/basictypes.h" -#include "base/logging.h" - -namespace remoting { - -class ClientLogger { - public: - ClientLogger(); - virtual ~ClientLogger(); - - void Log(logging::LogSeverity severity, const char* format, ...); - void VLog(int verboselevel, const char* format, ...); - - virtual void va_Log(logging::LogSeverity severity, - const char* format, va_list ap); - virtual void va_VLog(int verboselevel, const char* format, va_list ap); - - private: - DISALLOW_COPY_AND_ASSIGN(ClientLogger); -}; - -} // namespace remoting - -#endif // REMOTING_CLIENT_CLIENT_LOGGER_H_ diff --git a/remoting/client/plugin/pepper_client_logger.cc b/remoting/client/plugin/pepper_client_logger.cc index c2fab45..6862e63 100644 --- a/remoting/client/plugin/pepper_client_logger.cc +++ b/remoting/client/plugin/pepper_client_logger.cc @@ -21,10 +21,6 @@ PepperClientLogger::PepperClientLogger(ChromotingInstance* instance) PepperClientLogger::~PepperClientLogger() { } -// Copied from base/logging.cc. -const char* const log_severity_names[logging::LOG_NUM_SEVERITIES] = { - "INFO", "WARNING", "ERROR", "ERROR_REPORT", "FATAL" }; - void PepperClientLogger::va_Log(logging::LogSeverity severity, const char* format, va_list ap) { DCHECK(severity >= 0 && severity <= logging::LOG_NUM_SEVERITIES); diff --git a/remoting/client/plugin/pepper_client_logger.h b/remoting/client/plugin/pepper_client_logger.h index c953e71..98a3b42 100644 --- a/remoting/client/plugin/pepper_client_logger.h +++ b/remoting/client/plugin/pepper_client_logger.h @@ -5,7 +5,7 @@ #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_CLIENT_LOGGER_H_ #define REMOTING_CLIENT_PLUGIN_PEPPER_CLIENT_LOGGER_H_ -#include "remoting/client/client_logger.h" +#include "remoting/base/logger.h" #include "base/task.h" @@ -15,9 +15,9 @@ namespace remoting { class ChromotingInstance; -class PepperClientLogger : public ClientLogger { +class PepperClientLogger : public Logger { public: - PepperClientLogger(ChromotingInstance* instance); + explicit PepperClientLogger(ChromotingInstance* instance); virtual ~PepperClientLogger(); virtual void va_Log(logging::LogSeverity severity, const char* format, |