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

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

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, 4 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 | « no previous file | remoting/base/logger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_BASE_LOGGER_H_
6 #define REMOTING_BASE_LOGGER_H_
7
8 #include "base/basictypes.h"
9 #include "base/task.h"
10
11 class MessageLoop;
12
13 namespace remoting {
14
15 class Logger {
16 public:
17 Logger();
18 virtual ~Logger();
19
20 void SetThread(MessageLoop* message_loop) {
21 message_loop_ = message_loop;
22 }
23
24 void Log(logging::LogSeverity severity, const char* format, ...);
25 void VLog(int verboselevel, const char* format, ...);
26
27 void va_Log(logging::LogSeverity severity, const char* format, va_list ap);
28 void va_VLog(int verboselevel, const char* format, va_list ap);
29
30 protected:
31 // Log to the UI after switching to the correct thread.
32 void LogToUI_CorrectThread(const std::string& message);
33
34 virtual void LogToUI(const std::string& message);
35
36 static const char* const log_severity_names[];
37
38 // We want all the log messages to be posted to the same thread so that:
39 // (1) they are queued up in-order, and
40 // (2) we don't try to update the log at the same time from multiple threads.
41 MessageLoop* message_loop_;
42
43 private:
44 DISALLOW_COPY_AND_ASSIGN(Logger);
45 };
46
47 } // namespace remoting
48
49 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::Logger);
50
51 #endif // REMOTING_BASE_LOGGER_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/base/logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698