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

Side by Side Diff: remoting/base/logger.cc

Issue 7262015: Conenct Chromoting plugin debug log to JS UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/base/logger.h ('k') | remoting/client/chromoting_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/client/client_logger.h" 5 #include "remoting/base/logger.h"
6 6
7 #include <stdarg.h> // va_list 7 #include <stdarg.h> // va_list
8 8
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 10
11 namespace remoting { 11 namespace remoting {
12 12
13 ClientLogger::ClientLogger() { 13 // Copied from base/logging.cc.
14 const char* const Logger::log_severity_names[logging::LOG_NUM_SEVERITIES] = {
15 "INFO", "WARNING", "ERROR", "ERROR_REPORT", "FATAL" };
dmac 2011/07/06 19:51:50 I would probably put the close brace on it's own l
16
17 Logger::Logger() {
14 } 18 }
15 19
16 ClientLogger::~ClientLogger() { 20 Logger::~Logger() {
17 } 21 }
18 22
19 void ClientLogger::Log(logging::LogSeverity severity, const char* format, ...) { 23 void Logger::Log(logging::LogSeverity severity, const char* format, ...) {
20 va_list ap; 24 va_list ap;
21 va_start(ap, format); 25 va_start(ap, format);
22 va_Log(severity, format, ap); 26 va_Log(severity, format, ap);
23 va_end(ap); 27 va_end(ap);
24 } 28 }
25 29
26 void ClientLogger::VLog(int verboselevel, const char* format, ...) { 30 void Logger::VLog(int verboselevel, const char* format, ...) {
27 va_list ap; 31 va_list ap;
28 va_start(ap, format); 32 va_start(ap, format);
29 va_VLog(verboselevel, format, ap); 33 va_VLog(verboselevel, format, ap);
30 va_end(ap); 34 va_end(ap);
31 } 35 }
32 36
33 void ClientLogger::va_Log(logging::LogSeverity severity, 37 void Logger::va_Log(logging::LogSeverity severity,
34 const char* format, va_list ap) { 38 const char* format, va_list ap) {
35 std::string message; 39 std::string message;
36 base::StringAppendV(&message, format, ap); 40 base::StringAppendV(&message, format, ap);
37 logging::LogMessage(__FILE__, __LINE__, severity).stream() << message; 41 logging::LogMessage(__FILE__, __LINE__, severity).stream() << message;
38 } 42 }
39 43
40 void ClientLogger::va_VLog(int verboselevel, const char* format, va_list ap) { 44 void Logger::va_VLog(int verboselevel, const char* format, va_list ap) {
41 std::string message; 45 std::string message;
42 base::StringAppendV(&message, format, ap); 46 base::StringAppendV(&message, format, ap);
43 VLOG(verboselevel) << message; 47 VLOG(verboselevel) << message;
44 } 48 }
45 49
46 } // namespace remoting 50 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/logger.h ('k') | remoting/client/chromoting_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698