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

Unified Diff: runtime/bin/socket_android.cc

Issue 11312242: Revised CL for customisable logging (replacing printfs). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | « runtime/bin/process_win.cc ('k') | runtime/bin/socket_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_android.cc
===================================================================
--- runtime/bin/socket_android.cc (revision 15092)
+++ runtime/bin/socket_android.cc (working copy)
@@ -8,8 +8,9 @@
#include <string.h>
#include <unistd.h>
+#include "bin/socket.h"
#include "bin/fdutils.h"
-#include "bin/socket.h"
+#include "bin/log.h"
bool Socket::Initialize() {
@@ -25,7 +26,7 @@
fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
if (fd < 0) {
- fprintf(stderr, "Error CreateConnect: %s\n", strerror(errno));
+ Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
return -1;
}
@@ -35,7 +36,7 @@
server = gethostbyname(host);
if (server == NULL) {
TEMP_FAILURE_RETRY(close(fd));
- fprintf(stderr, "Error CreateConnect: %s\n", strerror(errno));
+ Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
return -1;
}
@@ -93,7 +94,7 @@
getsockname(fd,
reinterpret_cast<struct sockaddr *>(&socket_address),
&size))) {
- fprintf(stderr, "Error getsockname: %s\n", strerror(errno));
+ Log::PrintErr("Error getsockname: %s\n", strerror(errno));
return 0;
}
return ntohs(socket_address.sin_port);
@@ -108,14 +109,14 @@
getpeername(fd,
reinterpret_cast<struct sockaddr *>(&socket_address),
&size))) {
- fprintf(stderr, "Error getpeername: %s\n", strerror(errno));
+ Log::PrintErr("Error getpeername: %s\n", strerror(errno));
return false;
}
if (inet_ntop(socket_address.sin_family,
reinterpret_cast<const void *>(&socket_address.sin_addr),
host,
INET_ADDRSTRLEN) == NULL) {
- fprintf(stderr, "Error inet_ntop: %s\n", strerror(errno));
+ Log::PrintErr("Error inet_ntop: %s\n", strerror(errno));
return false;
}
*port = ntohs(socket_address.sin_port);
@@ -185,7 +186,7 @@
fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
if (fd < 0) {
- fprintf(stderr, "Error CreateBind: %s\n", strerror(errno));
+ Log::PrintErr("Error CreateBind: %s\n", strerror(errno));
return -1;
}
@@ -205,12 +206,12 @@
reinterpret_cast<struct sockaddr *>(&server_address),
sizeof(server_address))) < 0) {
TEMP_FAILURE_RETRY(close(fd));
- fprintf(stderr, "Error Bind: %s\n", strerror(errno));
+ Log::PrintErr("Error Bind: %s\n", strerror(errno));
return -1;
}
if (TEMP_FAILURE_RETRY(listen(fd, backlog)) != 0) {
- fprintf(stderr, "Error Listen: %s\n", strerror(errno));
+ Log::PrintErr("Error Listen: %s\n", strerror(errno));
return -1;
}
« no previous file with comments | « runtime/bin/process_win.cc ('k') | runtime/bin/socket_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698