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

Side by Side Diff: dbus/object_proxy.cc

Issue 1609563002: Remove logging::LogAtLevel and rewrite its sole caller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: conditionally use LOG(ERROR) or LOG(WARNING) Created 4 years, 11 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
« no previous file with comments | « base/logging.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "dbus/object_proxy.h" 5 #include "dbus/object_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 } 558 }
559 559
560 void ObjectProxy::LogMethodCallFailure( 560 void ObjectProxy::LogMethodCallFailure(
561 const base::StringPiece& interface_name, 561 const base::StringPiece& interface_name,
562 const base::StringPiece& method_name, 562 const base::StringPiece& method_name,
563 const base::StringPiece& error_name, 563 const base::StringPiece& error_name,
564 const base::StringPiece& error_message) const { 564 const base::StringPiece& error_message) const {
565 if (ignore_service_unknown_errors_ && 565 if (ignore_service_unknown_errors_ &&
566 (error_name == kErrorServiceUnknown || error_name == kErrorObjectUnknown)) 566 (error_name == kErrorServiceUnknown || error_name == kErrorObjectUnknown))
567 return; 567 return;
568 logging::LogSeverity severity = logging::LOG_ERROR; 568
569 std::ostringstream msg;
570 msg << "Failed to call method: " << interface_name << "." << method_name
571 << ": object_path= " << object_path_.value()
572 << ": " << error_name << ": " << error_message;
573
569 // "UnknownObject" indicates that an object or service is no longer available, 574 // "UnknownObject" indicates that an object or service is no longer available,
570 // e.g. a Shill network service has gone out of range. Treat these as warnings 575 // e.g. a Shill network service has gone out of range. Treat these as warnings
571 // not errors. 576 // not errors.
572 if (error_name == kErrorObjectUnknown) 577 if (error_name == kErrorObjectUnknown)
573 severity = logging::LOG_WARNING; 578 LOG(WARNING) << msg.str();
574 std::ostringstream msg; 579 else
575 msg << "Failed to call method: " << interface_name << "." << method_name 580 LOG(ERROR) << msg.str();
576 << ": object_path= " << object_path_.value()
577 << ": " << error_name << ": " << error_message;
578 logging::LogAtLevel(severity, msg.str());
579 } 581 }
580 582
581 void ObjectProxy::OnCallMethodError(const std::string& interface_name, 583 void ObjectProxy::OnCallMethodError(const std::string& interface_name,
582 const std::string& method_name, 584 const std::string& method_name,
583 ResponseCallback response_callback, 585 ResponseCallback response_callback,
584 ErrorResponse* error_response) { 586 ErrorResponse* error_response) {
585 if (error_response) { 587 if (error_response) {
586 // Error message may contain the error message as string. 588 // Error message may contain the error message as string.
587 MessageReader reader(error_response); 589 MessageReader reader(error_response);
588 std::string error_message; 590 std::string error_message;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 bool service_is_available) { 705 bool service_is_available) {
704 bus_->AssertOnOriginThread(); 706 bus_->AssertOnOriginThread();
705 707
706 std::vector<WaitForServiceToBeAvailableCallback> callbacks; 708 std::vector<WaitForServiceToBeAvailableCallback> callbacks;
707 callbacks.swap(wait_for_service_to_be_available_callbacks_); 709 callbacks.swap(wait_for_service_to_be_available_callbacks_);
708 for (size_t i = 0; i < callbacks.size(); ++i) 710 for (size_t i = 0; i < callbacks.size(); ++i)
709 callbacks[i].Run(service_is_available); 711 callbacks[i].Run(service_is_available);
710 } 712 }
711 713
712 } // namespace dbus 714 } // namespace dbus
OLDNEW
« no previous file with comments | « base/logging.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698