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

Unified Diff: remoting/base/logger.cc

Issue 7355011: Modify Chromoting logging to hook into base logging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/logger.h ('k') | remoting/base/task_thread_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/logger.cc
diff --git a/remoting/base/logger.cc b/remoting/base/logger.cc
deleted file mode 100644
index 714ad2008df0c5fef6fa30144ffaa2ad12cd6f60..0000000000000000000000000000000000000000
--- a/remoting/base/logger.cc
+++ /dev/null
@@ -1,95 +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/base/logger.h"
-
-#include <stdarg.h> // va_list
-
-#include "base/logging.h"
-#include "base/message_loop.h"
-#include "base/stringprintf.h"
-
-namespace remoting {
-
-// Copied from base/logging.cc.
-const char* const Logger::log_severity_names[logging::LOG_NUM_SEVERITIES] = {
- "INFO", "WARNING", "ERROR", "ERROR_REPORT", "FATAL"
-};
-
-Logger::Logger()
- : message_loop_(NULL) {
-}
-
-Logger::~Logger() {
-}
-
-void Logger::Log(logging::LogSeverity severity, const char* format, ...) {
- va_list ap;
- va_start(ap, format);
- va_Log(severity, format, ap);
- va_end(ap);
-}
-
-void Logger::VLog(int verboselevel, const char* format, ...) {
- va_list ap;
- va_start(ap, format);
- va_VLog(verboselevel, format, ap);
- va_end(ap);
-}
-
-void Logger::va_Log(logging::LogSeverity severity,
- const char* format, va_list ap) {
- DCHECK(severity >= 0 && severity <= logging::LOG_NUM_SEVERITIES);
-
- // Based in LOG_IS_ON macro in base/logging.h.
- if (severity >= ::logging::GetMinLogLevel()) {
- std::string message;
- base::StringAppendV(&message, format, ap);
-
- // Standard logging.
- logging::LogMessage(__FILE__, __LINE__, severity).stream() << message;
-
- // Send log message to the host UI.
- LogToUI_CorrectThread(StringPrintf("LOG(%s) %s",
- log_severity_names[severity],
- message.c_str()));
- }
-
- va_end(ap);
-}
-
-void Logger::va_VLog(int verboselevel,
- const char* format,
- va_list ap) {
- if (VLOG_IS_ON(verboselevel)) {
- std::string message;
- base::StringAppendV(&message, format, ap);
-
- // Standard verbose logging.
- VLOG(verboselevel) << message;
-
- // Send log message to the host UI.
- LogToUI_CorrectThread(StringPrintf("VLOG(%d) %s",
- verboselevel, message.c_str()));
- }
-}
-
-void Logger::LogToUI_CorrectThread(const std::string& message) {
- if (!message_loop_)
- return;
-
- if (message_loop_ != MessageLoop::current()) {
- message_loop_->PostTask(
- FROM_HERE,
- NewRunnableMethod(this, &Logger::LogToUI_CorrectThread, message));
- return;
- }
-
- LogToUI(message);
-}
-
-void Logger::LogToUI(const std::string& message) {
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/base/logger.h ('k') | remoting/base/task_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698