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

Unified Diff: mojo/public/cpp/bindings/lib/validation_errors.cc

Issue 344983002: Replace fprintf with mojo logging macro. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/tests/validation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/validation_errors.cc
diff --git a/mojo/public/cpp/bindings/lib/validation_errors.cc b/mojo/public/cpp/bindings/lib/validation_errors.cc
index ed5904d396318d123add33def50deda889688078..d830f02fc3c4a57ccbea7cf1221114a2350f6fd1 100644
--- a/mojo/public/cpp/bindings/lib/validation_errors.cc
+++ b/mojo/public/cpp/bindings/lib/validation_errors.cc
@@ -5,7 +5,8 @@
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include <assert.h>
-#include <stdio.h>
+
+#include "mojo/public/cpp/environment/logging.h"
namespace mojo {
namespace internal {
@@ -41,12 +42,10 @@ const char* ValidationErrorToString(ValidationError error) {
}
void ReportValidationError(ValidationError error) {
- if (g_validation_error_observer) {
+ if (g_validation_error_observer)
g_validation_error_observer->set_last_error(error);
- } else {
- // TODO(yzshen): Consider adding better logging support.
- fprintf(stderr, "Invalid message: %s\n", ValidationErrorToString(error));
- }
+ else
+ MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error);
}
ValidationErrorObserverForTesting::ValidationErrorObserverForTesting()
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/tests/validation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698