OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 #include "remoting/host/host_event_logger.h" | |
6 | |
7 #include "net/base/ip_endpoint.h" | |
8 #include "remoting/host/chromoting_host.h" | |
9 #include "remoting/host/system_event_logger.h" | |
10 | |
11 namespace remoting { | |
12 | |
13 HostEventLogger::HostEventLogger(ChromotingHost* host, | |
14 const std::string& application_name) | |
15 : host_(host), | |
16 system_event_logger_(SystemEventLogger::Create(application_name)) { | |
17 host_->AddStatusObserver(this); | |
18 } | |
19 | |
20 HostEventLogger::~HostEventLogger() { | |
21 host_->RemoveStatusObserver(this); | |
22 } | |
23 | |
24 void HostEventLogger::OnClientAuthenticated(const std::string& jid) { | |
25 Log("Client connected: " + jid); | |
26 } | |
27 | |
28 void HostEventLogger::OnClientDisconnected(const std::string& jid) { | |
29 Log("Client disconnected: " + jid); | |
30 } | |
31 | |
32 void HostEventLogger::OnAccessDenied(const std::string& jid) { | |
33 Log("Access denied for client: " + jid); | |
34 } | |
35 | |
36 void HostEventLogger::OnClientRouteChange( | |
37 const std::string& jid, | |
38 const std::string& channel_name, | |
39 const net::IPEndPoint& remote_end_point, | |
40 const net::IPEndPoint& local_end_point) { | |
41 Log("Channel IP for client: " + jid + | |
42 " ip='" + remote_end_point.ToString() + | |
43 "' host_ip='" + local_end_point.ToString() + | |
44 "' channel='" + channel_name + "'"); | |
45 } | |
46 | |
47 void HostEventLogger::OnShutdown() { | |
48 } | |
49 | |
50 void HostEventLogger::Log(const std::string& message) { | |
51 system_event_logger_->Log(message); | |
52 } | |
53 | |
54 } // namespace remoting | |
OLD | NEW |