Chromium Code Reviews| 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("Host started"); | |
|
Jamie
2012/07/18 23:21:34
Please run this string by the relevant stakeholder
Sergey Ulanov
2012/07/18 23:28:17
It's already possible to do that - syslog logs app
Lambros
2012/07/18 23:40:56
I think this string is sufficiently distinctive fr
Wez
2012/07/19 00:41:29
nit: I think this can simply be "Started" - we alr
Lambros
2012/07/19 01:36:34
OK. If we ever need Host/Client distinction, that
| |
| 59 } | 60 } |
| 60 | 61 |
| 61 HostEventLoggerPosix::~HostEventLoggerPosix() { | 62 HostEventLoggerPosix::~HostEventLoggerPosix() { |
| 62 host_->RemoveStatusObserver(this); | 63 host_->RemoveStatusObserver(this); |
| 63 closelog(); | 64 closelog(); |
|
Sergey Ulanov
2012/07/18 23:28:17
also log when the host is stopped?
Lambros
2012/07/18 23:40:56
For Linux Me2Me at least, that code doesn't seem t
| |
| 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 } |
| 69 | 70 |
| 70 void HostEventLoggerPosix::OnClientDisconnected(const std::string& jid) { | 71 void HostEventLoggerPosix::OnClientDisconnected(const std::string& jid) { |
| 71 Log("Client disconnected: " + jid); | 72 Log("Client disconnected: " + jid); |
| 72 } | 73 } |
| 73 | 74 |
| (...skipping 21 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 |