diff options
author | weitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-26 23:19:50 +0000 |
---|---|---|
committer | weitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-26 23:19:50 +0000 |
commit | 6f742dd07eaf78c0defb248e487a53480b1971e1 (patch) | |
tree | 1b74af19be8a3f88885dc58af84536cef418bf8f | |
parent | c9428a13d50b30e285d1e4910ca98775572e7b49 (diff) | |
download | chromium_src-6f742dd07eaf78c0defb248e487a53480b1971e1.zip chromium_src-6f742dd07eaf78c0defb248e487a53480b1971e1.tar.gz chromium_src-6f742dd07eaf78c0defb248e487a53480b1971e1.tar.bz2 |
Replace all usage of LOG(INFO) in Chromoting host with HOST_LOG to bypass the presubmit check. This won't spam the chrome output because the chromoting host code doesn't run in the chrome processes.
BUG=
Review URL: https://codereview.chromium.org/86523005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237431 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | PRESUBMIT.py | 3 | ||||
-rw-r--r-- | remoting/base/logging.h | 21 | ||||
-rw-r--r-- | remoting/host/chromoting_host.cc | 6 | ||||
-rw-r--r-- | remoting/host/client_session.cc | 3 | ||||
-rw-r--r-- | remoting/host/curtain_mode_linux.cc | 12 | ||||
-rw-r--r-- | remoting/host/desktop_resizer_linux.cc | 4 | ||||
-rw-r--r-- | remoting/host/desktop_resizer_mac.cc | 4 | ||||
-rw-r--r-- | remoting/host/dns_blackhole_checker.cc | 9 | ||||
-rw-r--r-- | remoting/host/heartbeat_sender.cc | 4 | ||||
-rw-r--r-- | remoting/host/host_status_sender.cc | 6 | ||||
-rw-r--r-- | remoting/host/host_status_sender_unittest.cc | 6 | ||||
-rw-r--r-- | remoting/host/input_injector_linux.cc | 4 | ||||
-rw-r--r-- | remoting/host/it2me/it2me_host.cc | 5 | ||||
-rw-r--r-- | remoting/host/linux/x_server_clipboard.cc | 4 | ||||
-rw-r--r-- | remoting/host/pam_authorization_factory_posix.cc | 6 | ||||
-rw-r--r-- | remoting/host/plugin/host_log_handler.cc | 3 | ||||
-rw-r--r-- | remoting/host/plugin/host_script_object.cc | 5 | ||||
-rw-r--r-- | remoting/host/plugin/host_script_object.h | 2 | ||||
-rw-r--r-- | remoting/host/remoting_me2me_host.cc | 30 | ||||
-rw-r--r-- | remoting/host/signaling_connector.cc | 19 |
20 files changed, 90 insertions, 66 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 1c1e491..9ad9cd1 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -832,7 +832,8 @@ def _CheckSpamLogging(input_api, output_api): black_list = (_EXCLUDED_PATHS + _TEST_CODE_EXCLUDED_PATHS + input_api.DEFAULT_BLACK_LIST + - (r"^base[\\\/]logging\.h$",)) + (r"^base[\\\/]logging\.h$", + r"^remoting[\\\/]base[\\\/]logging\.h$",)) source_file_filter = lambda x: input_api.FilterSourceFile( x, white_list=(file_inclusion_pattern,), black_list=black_list) diff --git a/remoting/base/logging.h b/remoting/base/logging.h new file mode 100644 index 0000000..77f618c --- /dev/null +++ b/remoting/base/logging.h @@ -0,0 +1,21 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef REMOTING_BASE_LOGGING_H_ +#define REMOTING_BASE_LOGGING_H_ + +#include "base/logging.h" + +namespace remoting { + +// Chromoting host code should use HOST_LOG instead of LOG(INFO) to bypass +// the CheckSpamLogging presubmit check. This won't spam chrome output because +// it runs in the chromoting host processes. +// In the future we may also consider writing to a log file instead of the +// console. +#define HOST_LOG LOG(INFO) + +} // namespace remoting + +#endif // REMOTING_BASE_LOGGING_H_ diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc index 80cd8b5..e4bdae7 100644 --- a/remoting/host/chromoting_host.cc +++ b/remoting/host/chromoting_host.cc @@ -8,10 +8,10 @@ #include "base/bind.h" #include "base/callback.h" -#include "base/logging.h" #include "base/message_loop/message_loop_proxy.h" #include "build/build_config.h" #include "remoting/base/constants.h" +#include "remoting/base/logging.h" #include "remoting/host/chromoting_host_context.h" #include "remoting/host/desktop_environment.h" #include "remoting/host/host_config.h" @@ -117,7 +117,7 @@ void ChromotingHost::Start(const std::string& host_owner) { DCHECK(CalledOnValidThread()); DCHECK(!started_); - LOG(INFO) << "Starting host"; + HOST_LOG << "Starting host"; started_ = true; FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnStart(host_owner)); @@ -287,7 +287,7 @@ void ChromotingHost::OnIncomingSession( *response = protocol::SessionManager::ACCEPT; - LOG(INFO) << "Client connected: " << session->jid(); + HOST_LOG << "Client connected: " << session->jid(); // Create a client object. scoped_ptr<protocol::ConnectionToClient> connection( diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc index 1a5e36b..c15b6fb 100644 --- a/remoting/host/client_session.cc +++ b/remoting/host/client_session.cc @@ -8,6 +8,7 @@ #include "base/message_loop/message_loop_proxy.h" #include "remoting/base/capabilities.h" +#include "remoting/base/logging.h" #include "remoting/codec/audio_encoder.h" #include "remoting/codec/audio_encoder_opus.h" #include "remoting/codec/audio_encoder_verbatim.h" @@ -199,7 +200,7 @@ void ClientSession::DeliverClientMessage( } } // No messages are currently supported. - LOG(INFO) << "Unexpected message received: " + HOST_LOG << "Unexpected message received: " << message.type() << ": " << message.data(); } diff --git a/remoting/host/curtain_mode_linux.cc b/remoting/host/curtain_mode_linux.cc index 9b54d05..5e15180 100644 --- a/remoting/host/curtain_mode_linux.cc +++ b/remoting/host/curtain_mode_linux.cc @@ -7,8 +7,8 @@ #include <X11/extensions/XInput.h> #include "base/callback.h" -#include "base/logging.h" #include "base/single_thread_task_runner.h" +#include "remoting/base/logging.h" #include "remoting/host/client_session_control.h" namespace remoting { @@ -68,7 +68,7 @@ bool CurtainModeLinux::IsXvfbSession() { found_xvfb_mouse = true; } else if (strcmp(device_info->name, "Virtual core XTEST pointer") != 0) { found_other_devices = true; - LOG(INFO) << "Non Xvfb mouse found: " << device_info->name; + HOST_LOG << "Non Xvfb mouse found: " << device_info->name; } } else if (device_info->use == IsXExtensionKeyboard) { if (strcmp(device_info->name, "Xvfb keyboard") == 0) { @@ -76,21 +76,21 @@ bool CurtainModeLinux::IsXvfbSession() { } else if (strcmp(device_info->name, "Virtual core XTEST keyboard") != 0) { found_other_devices = true; - LOG(INFO) << "Non Xvfb keyboard found: " << device_info->name; + HOST_LOG << "Non Xvfb keyboard found: " << device_info->name; } } else if (device_info->use == IsXPointer) { if (strcmp(device_info->name, "Virtual core pointer") != 0) { found_other_devices = true; - LOG(INFO) << "Non Xvfb mouse found: " << device_info->name; + HOST_LOG << "Non Xvfb mouse found: " << device_info->name; } } else if (device_info->use == IsXKeyboard) { if (strcmp(device_info->name, "Virtual core keyboard") != 0) { found_other_devices = true; - LOG(INFO) << "Non Xvfb keyboard found: " << device_info->name; + HOST_LOG << "Non Xvfb keyboard found: " << device_info->name; } } else { found_other_devices = true; - LOG(INFO) << "Non Xvfb device found: " << device_info->name; + HOST_LOG << "Non Xvfb device found: " << device_info->name; } } XFreeDeviceList(devices); diff --git a/remoting/host/desktop_resizer_linux.cc b/remoting/host/desktop_resizer_linux.cc index 1ecca28..3ebdea3 100644 --- a/remoting/host/desktop_resizer_linux.cc +++ b/remoting/host/desktop_resizer_linux.cc @@ -10,7 +10,7 @@ #include <X11/Xlib.h> #include "base/command_line.h" -#include "base/logging.h" +#include "remoting/base/logging.h" // On Linux, we use the xrandr extension to change the desktop resolution. For // now, we only support resize-to-client for Xvfb-based servers that can match @@ -253,7 +253,7 @@ void DesktopResizerLinux::SetResolution(const ScreenResolution& resolution) { // that we have to detach the output from any mode in order to resize it // (strictly speaking, this is only required when reducing the size, but it // seems safe to do it regardless). - LOG(INFO) << "Changing desktop size to " << resolution.dimensions().width() + HOST_LOG << "Changing desktop size to " << resolution.dimensions().width() << "x" << resolution.dimensions().height(); // TODO(lambroslambrou): Use the DPI from client size information. diff --git a/remoting/host/desktop_resizer_mac.cc b/remoting/host/desktop_resizer_mac.cc index 0cec2a9..8bb4c46 100644 --- a/remoting/host/desktop_resizer_mac.cc +++ b/remoting/host/desktop_resizer_mac.cc @@ -7,10 +7,10 @@ #include <Carbon/Carbon.h> #include "base/basictypes.h" -#include "base/logging.h" #include "base/mac/foundation_util.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" +#include "remoting/base/logging.h" namespace { // TODO(jamiewalch): Use the correct DPI for the mode: http://crbug.com/172405. @@ -104,7 +104,7 @@ void DesktopResizerMac::SetResolution(const ScreenResolution& resolution) { } } if (best_mode) { - LOG(INFO) << "Changing mode to " << best_mode << " (" + HOST_LOG << "Changing mode to " << best_mode << " (" << resolution.dimensions().width() << "x" << "x" << resolution.dimensions().height() << "x" << best_depth << " @ " diff --git a/remoting/host/dns_blackhole_checker.cc b/remoting/host/dns_blackhole_checker.cc index d7f48e3..37ed0ae 100644 --- a/remoting/host/dns_blackhole_checker.cc +++ b/remoting/host/dns_blackhole_checker.cc @@ -6,6 +6,7 @@ #include "net/url_request/url_fetcher.h" #include "net/url_request/url_request_context_getter.h" +#include "remoting/base/logging.h" #include "url/gurl.h" namespace remoting { @@ -33,10 +34,10 @@ void DnsBlackholeChecker::OnURLFetchComplete(const net::URLFetcher* source) { int response = source->GetResponseCode(); bool allow = false; if (source->GetResponseCode() == 200) { - LOG(INFO) << "Successfully connected to host talkgadget."; + HOST_LOG << "Successfully connected to host talkgadget."; allow = true; } else { - LOG(INFO) << "Unable to connect to host talkgadget (" << response << ")"; + HOST_LOG << "Unable to connect to host talkgadget (" << response << ")"; } url_fetcher_.reset(NULL); callback_.Run(allow); @@ -56,13 +57,13 @@ void DnsBlackholeChecker::CheckForDnsBlackhole( talkgadget_url += talkgadget_prefix_; } talkgadget_url += kTalkGadgetUrl; - LOG(INFO) << "Verifying connection to " << talkgadget_url; + HOST_LOG << "Verifying connection to " << talkgadget_url; url_fetcher_.reset(net::URLFetcher::Create(GURL(talkgadget_url), net::URLFetcher::GET, this)); url_fetcher_->SetRequestContext(url_request_context_getter_.get()); url_fetcher_->Start(); } else { - LOG(INFO) << "Pending connection check"; + HOST_LOG << "Pending connection check"; } } diff --git a/remoting/host/heartbeat_sender.cc b/remoting/host/heartbeat_sender.cc index ea345a3..b489cbe 100644 --- a/remoting/host/heartbeat_sender.cc +++ b/remoting/host/heartbeat_sender.cc @@ -7,13 +7,13 @@ #include <math.h> #include "base/bind.h" -#include "base/logging.h" #include "base/message_loop/message_loop_proxy.h" #include "base/rand_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringize_macros.h" #include "base/time/time.h" #include "remoting/base/constants.h" +#include "remoting/base/logging.h" #include "remoting/host/server_log_entry.h" #include "remoting/jingle_glue/iq_sender.h" #include "remoting/jingle_glue/signal_strategy.h" @@ -228,7 +228,7 @@ void HeartbeatSender::SetSequenceId(int sequence_id) { if (!sequence_id_was_set_) { ResendStanza(); } else { - LOG(INFO) << "The heartbeat sequence ID has been set more than once: " + HOST_LOG << "The heartbeat sequence ID has been set more than once: " << "the new value is " << sequence_id; double delay = pow(2.0, sequence_id_recent_set_num_) * (1 + base::RandDouble()) * kResendDelayMs; diff --git a/remoting/host/host_status_sender.cc b/remoting/host/host_status_sender.cc index 87df16f..545fce4 100644 --- a/remoting/host/host_status_sender.cc +++ b/remoting/host/host_status_sender.cc @@ -4,11 +4,11 @@ #include "remoting/host/host_status_sender.h" -#include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringize_macros.h" #include "base/time/time.h" #include "remoting/base/constants.h" +#include "remoting/base/logging.h" #include "remoting/host/server_log_entry.h" #include "remoting/jingle_glue/iq_sender.h" #include "remoting/jingle_glue/signal_strategy.h" @@ -79,7 +79,7 @@ void HostStatusSender::SendHostStatus(HostStatus status, HostExitCodes exit_code) { SignalStrategy::State state = signal_strategy_->GetState(); if (state == SignalStrategy::CONNECTED) { - LOG(INFO) << "Sending host status '" + HOST_LOG << "Sending host status '" << HostStatusToString(status) << "' to " << directory_bot_jid_; @@ -89,7 +89,7 @@ void HostStatusSender::SendHostStatus(HostStatus status, CreateHostStatusMessage(status, exit_code), IqSender::ReplyCallback()); } else { - LOG(INFO) << "Cannot send host status to '" + HOST_LOG << "Cannot send host status to '" << directory_bot_jid_ << " ' because the state of the SignalStrategy is " << state; diff --git a/remoting/host/host_status_sender_unittest.cc b/remoting/host/host_status_sender_unittest.cc index 11da627..8d87aaf 100644 --- a/remoting/host/host_status_sender_unittest.cc +++ b/remoting/host/host_status_sender_unittest.cc @@ -7,6 +7,7 @@ #include "base/strings/string_number_conversions.h" #include "base/time/time.h" #include "remoting/base/constants.h" +#include "remoting/base/logging.h" #include "remoting/base/rsa_key_pair.h" #include "remoting/base/test_rsa_key_pair.h" #include "remoting/host/host_exit_codes.h" @@ -87,7 +88,6 @@ TEST_F(HostStatusSenderTest, SendOnlineStatus) { scoped_ptr<XmlElement> stanza(sent_iq); ASSERT_TRUE(stanza != NULL); - LOG(INFO) << stanza->Str(); ValidateHostStatusStanza(stanza.get(), HostStatusSender::ONLINE); } @@ -116,7 +116,6 @@ TEST_F(HostStatusSenderTest, SendOfflineStatus) { scoped_ptr<XmlElement> stanza(sent_iq); ASSERT_TRUE(stanza != NULL); - LOG(INFO) << stanza->Str(); ValidateHostStatusStanza(stanza.get(), HostStatusSender::OFFLINE); } @@ -192,9 +191,6 @@ void HostStatusSenderTest::ValidateSignature( std::string expected_signature = key_pair->SignMessage(message); EXPECT_EQ(expected_signature, signature->BodyText()); - - int64 now = static_cast<int64>(base::Time::Now().ToDoubleT()); - LOG(INFO) << "SendHostStatus took " << now - time << " seconds."; } } // namespace remoting diff --git a/remoting/host/input_injector_linux.cc b/remoting/host/input_injector_linux.cc index 678216d..94dcbd3 100644 --- a/remoting/host/input_injector_linux.cc +++ b/remoting/host/input_injector_linux.cc @@ -14,8 +14,8 @@ #include "base/bind.h" #include "base/compiler_specific.h" #include "base/location.h" -#include "base/logging.h" #include "base/single_thread_task_runner.h" +#include "remoting/base/logging.h" #include "remoting/host/clipboard.h" #include "remoting/proto/internal.pb.h" #include "third_party/skia/include/core/SkPoint.h" @@ -433,7 +433,7 @@ void InputInjectorLinux::Core::InitMouseButtonMap() { XFreeDeviceList(devices); if (!device_found) { - LOG(INFO) << "Cannot find XTest device."; + HOST_LOG << "Cannot find XTest device."; return; } diff --git a/remoting/host/it2me/it2me_host.cc b/remoting/host/it2me/it2me_host.cc index 465ca27..771d65b 100644 --- a/remoting/host/it2me/it2me_host.cc +++ b/remoting/host/it2me/it2me_host.cc @@ -10,6 +10,7 @@ #include "base/threading/platform_thread.h" #include "net/socket/client_socket_factory.h" #include "remoting/base/auto_thread.h" +#include "remoting/base/logging.h" #include "remoting/base/rsa_key_pair.h" #include "remoting/host/chromoting_host.h" #include "remoting/host/chromoting_host_context.h" @@ -180,7 +181,7 @@ void It2MeHost::FinishConnect() { register_request_ = register_request.Pass(); // If NAT traversal is off then limit port range to allow firewall pin-holing. - LOG(INFO) << "NAT state: " << nat_traversal_enabled_; + HOST_LOG << "NAT state: " << nat_traversal_enabled_; NetworkSettings network_settings( nat_traversal_enabled_ ? NetworkSettings::NAT_TRAVERSAL_ENABLED : @@ -295,7 +296,7 @@ void It2MeHost::OnClientAuthenticated(const std::string& jid) { if (pos != std::string::npos) client_username.replace(pos, std::string::npos, ""); - LOG(INFO) << "Client " << client_username << " connected."; + HOST_LOG << "Client " << client_username << " connected."; // Pass the client user name to the script object before changing state. plugin_task_runner_->PostTask( diff --git a/remoting/host/linux/x_server_clipboard.cc b/remoting/host/linux/x_server_clipboard.cc index 80be6cf..1b70b21 100644 --- a/remoting/host/linux/x_server_clipboard.cc +++ b/remoting/host/linux/x_server_clipboard.cc @@ -8,8 +8,8 @@ #include "base/basictypes.h" #include "base/callback.h" -#include "base/logging.h" #include "remoting/base/constants.h" +#include "remoting/base/logging.h" #include "remoting/base/util.h" namespace remoting { @@ -46,7 +46,7 @@ void XServerClipboard::Init(Display* display, int xfixes_error_base; if (!XFixesQueryExtension(display_, &xfixes_event_base_, &xfixes_error_base)) { - LOG(INFO) << "X server does not support XFixes."; + HOST_LOG << "X server does not support XFixes."; return; } diff --git a/remoting/host/pam_authorization_factory_posix.cc b/remoting/host/pam_authorization_factory_posix.cc index d82c701..6488852 100644 --- a/remoting/host/pam_authorization_factory_posix.cc +++ b/remoting/host/pam_authorization_factory_posix.cc @@ -9,7 +9,7 @@ #include "base/bind.h" #include "base/callback.h" #include "base/environment.h" -#include "base/logging.h" +#include "remoting/base/logging.h" #include "remoting/base/util.h" #include "remoting/protocol/channel_authenticator.h" #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" @@ -115,7 +115,7 @@ bool PamAuthorizer::IsLocalLoginAllowed() { } pam_end(handle, result); - LOG(INFO) << "Local login check for " << username + HOST_LOG << "Local login check for " << username << (result == PAM_SUCCESS ? " succeeded." : " failed."); return result == PAM_SUCCESS; @@ -140,7 +140,7 @@ int PamAuthorizer::PamConversation(int num_messages, LOG(ERROR) << "PAM conversation error message: " << message->msg; break; case PAM_TEXT_INFO: - LOG(INFO) << "PAM conversation message: " << message->msg; + HOST_LOG << "PAM conversation message: " << message->msg; break; default: LOG(FATAL) << "Unexpected PAM conversation response required: " diff --git a/remoting/host/plugin/host_log_handler.cc b/remoting/host/plugin/host_log_handler.cc index 9240b01..8095907 100644 --- a/remoting/host/plugin/host_log_handler.cc +++ b/remoting/host/plugin/host_log_handler.cc @@ -5,6 +5,7 @@ #include "remoting/host/plugin/host_log_handler.h" #include "base/lazy_instance.h" +#include "remoting/base/logging.h" #include "remoting/base/util.h" #include "remoting/host/plugin/host_script_object.h" @@ -37,7 +38,7 @@ void HostLogHandler::RegisterLogMessageHandler() { if (g_has_registered_log_handler) return; - LOG(INFO) << "Registering global log handler"; + HOST_LOG << "Registering global log handler"; // Record previous handler so we can call it in a chain. g_logging_old_handler = logging::GetLogMessageHandler(); diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc index 542f725..c443e9c 100644 --- a/remoting/host/plugin/host_script_object.cc +++ b/remoting/host/plugin/host_script_object.cc @@ -13,6 +13,7 @@ #include "base/strings/utf_string_conversions.h" #include "remoting/base/auth_token_util.h" #include "remoting/base/auto_thread.h" +#include "remoting/base/logging.h" #include "remoting/base/resources.h" #include "remoting/base/rsa_key_pair.h" #include "remoting/host/chromoting_host_context.h" @@ -447,7 +448,7 @@ bool HostNPScriptObject::Connect(const NPVariant* args, NPVariant* result) { DCHECK(plugin_task_runner_->BelongsToCurrentThread()); - LOG(INFO) << "Connecting..."; + HOST_LOG << "Connecting..."; if (arg_count != 2) { SetException("connect: bad number of arguments"); @@ -1104,7 +1105,7 @@ void HostNPScriptObject::SetException(const std::string& exception_string) { DCHECK(plugin_task_runner_->BelongsToCurrentThread()); g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); - LOG(INFO) << exception_string; + HOST_LOG << exception_string; } } // namespace remoting diff --git a/remoting/host/plugin/host_script_object.h b/remoting/host/plugin/host_script_object.h index 2558903..0bfe11e 100644 --- a/remoting/host/plugin/host_script_object.h +++ b/remoting/host/plugin/host_script_object.h @@ -49,7 +49,7 @@ class HostNPScriptObject : public It2MeHost::Observer { // Post LogDebugInfo to the correct proxy (and thus, on the correct thread). // This should only be called by HostLogHandler. To log to the UI, use the - // standard LOG(INFO) and it will be sent to this method. + // standard HOST_LOG and it will be sent to this method. void PostLogDebugInfo(const std::string& message); void SetWindow(NPWindow* np_window); diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index a2c1d94..9ab0819 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -13,7 +13,6 @@ #include "base/debug/alias.h" #include "base/file_util.h" #include "base/files/file_path.h" -#include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/single_thread_task_runner.h" @@ -35,6 +34,7 @@ #include "remoting/base/auto_thread_task_runner.h" #include "remoting/base/breakpad.h" #include "remoting/base/constants.h" +#include "remoting/base/logging.h" #include "remoting/base/rsa_key_pair.h" #include "remoting/base/util.h" #include "remoting/host/branding.h" @@ -423,7 +423,7 @@ void HostProcess::OnConfigUpdated( if (serialized_config_ == serialized_config) return; - LOG(INFO) << "Processing new host configuration."; + HOST_LOG << "Processing new host configuration."; serialized_config_ = serialized_config; scoped_ptr<JsonHostConfig> config(new JsonHostConfig(base::FilePath())); @@ -488,7 +488,7 @@ void HostProcess::StartOnNetworkThread() { void HostProcess::SigTermHandler(int signal_number) { DCHECK(signal_number == SIGTERM); DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); - LOG(INFO) << "Caught SIGTERM: Shutting down..."; + HOST_LOG << "Caught SIGTERM: Shutting down..."; ShutdownHost(kSuccessExitCode); } #endif // OS_POSIX @@ -659,7 +659,7 @@ void HostProcess::OnUnknownHostIdError() { } void HostProcess::OnHeartbeatSuccessful() { - LOG(INFO) << "Host ready to receive connections."; + HOST_LOG << "Host ready to receive connections."; #if defined(OS_POSIX) if (signal_parent_) { kill(getppid(), SIGUSR1); @@ -804,7 +804,7 @@ bool HostProcess::OnHostDomainPolicyUpdate(const std::string& host_domain) { // Returns true if the host has to be restarted after this policy update. DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); - LOG(INFO) << "Policy sets host domain: " << host_domain; + HOST_LOG << "Policy sets host domain: " << host_domain; if (!host_domain.empty() && !EndsWith(host_owner_, std::string("@") + host_domain, false)) { @@ -819,7 +819,7 @@ bool HostProcess::OnUsernamePolicyUpdate(bool curtain_required, DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); if (host_username_match_required) { - LOG(INFO) << "Policy requires host username match."; + HOST_LOG << "Policy requires host username match."; std::string username = GetUsername(); bool shutdown = username.empty() || !StartsWithASCII(host_owner_, username + std::string("@"), @@ -848,7 +848,7 @@ bool HostProcess::OnUsernamePolicyUpdate(bool curtain_required, ShutdownHost(kUsernameMismatchExitCode); } } else { - LOG(INFO) << "Policy does not require host username match."; + HOST_LOG << "Policy does not require host username match."; } return false; @@ -860,9 +860,9 @@ bool HostProcess::OnNatPolicyUpdate(bool nat_traversal_enabled) { if (allow_nat_traversal_ != nat_traversal_enabled) { if (nat_traversal_enabled) - LOG(INFO) << "Policy enables NAT traversal."; + HOST_LOG << "Policy enables NAT traversal."; else - LOG(INFO) << "Policy disables NAT traversal."; + HOST_LOG << "Policy disables NAT traversal."; allow_nat_traversal_ = nat_traversal_enabled; return true; } @@ -895,9 +895,9 @@ void HostProcess::OnCurtainPolicyUpdate(bool curtain_required) { if (curtain_required_ != curtain_required) { if (curtain_required) - LOG(INFO) << "Policy requires curtain-mode."; + HOST_LOG << "Policy requires curtain-mode."; else - LOG(INFO) << "Policy does not require curtain-mode."; + HOST_LOG << "Policy does not require curtain-mode."; curtain_required_ = curtain_required; if (host_) host_->SetEnableCurtaining(curtain_required_); @@ -910,7 +910,7 @@ bool HostProcess::OnHostTalkGadgetPrefixPolicyUpdate( DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); if (talkgadget_prefix != talkgadget_prefix_) { - LOG(INFO) << "Policy sets talkgadget prefix: " << talkgadget_prefix; + HOST_LOG << "Policy sets talkgadget prefix: " << talkgadget_prefix; talkgadget_prefix_ = talkgadget_prefix; return true; } @@ -925,7 +925,7 @@ bool HostProcess::OnHostTokenUrlPolicyUpdate( if (token_url_ != token_url || token_validation_url_ != token_validation_url) { - LOG(INFO) << "Policy sets third-party token URLs: " + HOST_LOG << "Policy sets third-party token URLs: " << "TokenUrl: " << token_url << ", " << "TokenValidationUrl: " << token_validation_url; @@ -944,9 +944,9 @@ bool HostProcess::OnPairingPolicyUpdate(bool allow_pairing) { return false; if (allow_pairing) - LOG(INFO) << "Policy enables client pairing."; + HOST_LOG << "Policy enables client pairing."; else - LOG(INFO) << "Policy disables client pairing."; + HOST_LOG << "Policy disables client pairing."; allow_pairing_ = allow_pairing; return true; } diff --git a/remoting/host/signaling_connector.cc b/remoting/host/signaling_connector.cc index ad9fbe5..710c3a2 100644 --- a/remoting/host/signaling_connector.cc +++ b/remoting/host/signaling_connector.cc @@ -10,6 +10,7 @@ #include "google_apis/google_api_keys.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_request_context_getter.h" +#include "remoting/base/logging.h" #include "remoting/host/dns_blackhole_checker.h" namespace remoting { @@ -71,10 +72,10 @@ void SignalingConnector::OnSignalStrategyStateChange( DCHECK(CalledOnValidThread()); if (state == SignalStrategy::CONNECTED) { - LOG(INFO) << "Signaling connected."; + HOST_LOG << "Signaling connected."; reconnect_attempts_ = 0; } else if (state == SignalStrategy::DISCONNECTED) { - LOG(INFO) << "Signaling disconnected."; + HOST_LOG << "Signaling disconnected."; reconnect_attempts_++; // If authentication failed then we have an invalid OAuth token, @@ -97,7 +98,7 @@ void SignalingConnector::OnConnectionTypeChanged( DCHECK(CalledOnValidThread()); if (type != net::NetworkChangeNotifier::CONNECTION_NONE && signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) { - LOG(INFO) << "Network state changed to online."; + HOST_LOG << "Network state changed to online."; ResetAndTryReconnect(); } } @@ -105,7 +106,7 @@ void SignalingConnector::OnConnectionTypeChanged( void SignalingConnector::OnIPAddressChanged() { DCHECK(CalledOnValidThread()); if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) { - LOG(INFO) << "IP address has changed."; + HOST_LOG << "IP address has changed."; ResetAndTryReconnect(); } } @@ -121,7 +122,7 @@ void SignalingConnector::OnRefreshTokenResponse( int expires_seconds) { DCHECK(CalledOnValidThread()); DCHECK(oauth_credentials_.get()); - LOG(INFO) << "Received OAuth token."; + HOST_LOG << "Received OAuth token."; oauth_access_token_ = access_token; auth_token_expiry_time_ = base::Time::Now() + @@ -134,7 +135,7 @@ void SignalingConnector::OnRefreshTokenResponse( void SignalingConnector::OnGetUserEmailResponse(const std::string& user_email) { DCHECK(CalledOnValidThread()); DCHECK(oauth_credentials_.get()); - LOG(INFO) << "Received user info."; + HOST_LOG << "Received user info."; if (user_email != oauth_credentials_->login) { LOG(ERROR) << "OAuth token and email address do not refer to " @@ -207,7 +208,7 @@ void SignalingConnector::OnDnsBlackholeCheckerDone(bool allow) { // an outright block. if (!allow) { reconnect_attempts_++; - LOG(INFO) << "Talkgadget check failed. Scheduling reconnect. Attempt " + HOST_LOG << "Talkgadget check failed. Scheduling reconnect. Attempt " << reconnect_attempts_; ScheduleTryReconnect(); return; @@ -220,7 +221,7 @@ void SignalingConnector::OnDnsBlackholeCheckerDone(bool allow) { if (need_new_auth_token) { RefreshOAuthToken(); } else { - LOG(INFO) << "Attempting to connect signaling."; + HOST_LOG << "Attempting to connect signaling."; signal_strategy_->Connect(); } } @@ -228,7 +229,7 @@ void SignalingConnector::OnDnsBlackholeCheckerDone(bool allow) { void SignalingConnector::RefreshOAuthToken() { DCHECK(CalledOnValidThread()); - LOG(INFO) << "Refreshing OAuth token."; + HOST_LOG << "Refreshing OAuth token."; DCHECK(!refreshing_oauth_token_); // Service accounts use different API keys, as they use the client app flow. |