| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/host/host_event_logger.h" | 5 #include "remoting/host/host_event_logger.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } //namespace | 51 } //namespace |
| 52 | 52 |
| 53 HostEventLoggerPosix::HostEventLoggerPosix(ChromotingHost* host, | 53 HostEventLoggerPosix::HostEventLoggerPosix(ChromotingHost* host, |
| 54 const std::string& application_name) | 54 const std::string& application_name) |
| 55 : host_(host), | 55 : host_(host), |
| 56 application_name_(application_name) { | 56 application_name_(application_name) { |
| 57 openlog(application_name_.c_str(), 0, LOG_USER); | 57 openlog(application_name_.c_str(), 0, LOG_USER); |
| 58 host_->AddStatusObserver(this); | 58 host_->AddStatusObserver(this); |
| 59 Log("Started"); |
| 59 } | 60 } |
| 60 | 61 |
| 61 HostEventLoggerPosix::~HostEventLoggerPosix() { | 62 HostEventLoggerPosix::~HostEventLoggerPosix() { |
| 62 host_->RemoveStatusObserver(this); | 63 host_->RemoveStatusObserver(this); |
| 63 closelog(); | 64 closelog(); |
| 64 } | 65 } |
| 65 | 66 |
| 66 void HostEventLoggerPosix::OnClientAuthenticated(const std::string& jid) { | 67 void HostEventLoggerPosix::OnClientAuthenticated(const std::string& jid) { |
| 67 Log("Client connected: " + jid); | 68 Log("Client connected: " + jid); |
| 68 } | 69 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 95 } | 96 } |
| 96 | 97 |
| 97 // static | 98 // static |
| 98 scoped_ptr<HostEventLogger> HostEventLogger::Create( | 99 scoped_ptr<HostEventLogger> HostEventLogger::Create( |
| 99 ChromotingHost* host, const std::string& application_name) { | 100 ChromotingHost* host, const std::string& application_name) { |
| 100 return scoped_ptr<HostEventLogger>( | 101 return scoped_ptr<HostEventLogger>( |
| 101 new HostEventLoggerPosix(host, application_name)); | 102 new HostEventLoggerPosix(host, application_name)); |
| 102 } | 103 } |
| 103 | 104 |
| 104 } // namespace remoting | 105 } // namespace remoting |
| OLD | NEW |