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

Unified Diff: runtime/bin/socket_win.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
Index: runtime/bin/socket_win.cc
===================================================================
--- runtime/bin/socket_win.cc (revision 14977)
+++ runtime/bin/socket_win.cc (working copy)
@@ -4,6 +4,7 @@
#include "bin/builtin.h"
#include "bin/eventhandler.h"
+#include "bin/log.h"
#include "bin/socket.h"
bool Socket::Initialize() {
@@ -12,7 +13,7 @@
WORD version_requested = MAKEWORD(1, 0);
err = WSAStartup(version_requested, &winsock_data);
if (err != 0) {
- fprintf(stderr, "Unable to initialize Winsock: %d\n", WSAGetLastError());
+ Log::PrintErr("Unable to initialize Winsock: %d\n", WSAGetLastError());
}
return err == 0;
}
@@ -43,7 +44,7 @@
if (getsockname(socket_handle->socket(),
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);
@@ -58,7 +59,7 @@
if (getpeername(socket_handle->socket(),
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;
}
*port = ntohs(socket_address.sin_port);
@@ -72,7 +73,7 @@
host,
&len);
if (err != 0) {
- fprintf(stderr, "Error WSAAddressToString: %d\n", WSAGetLastError());
+ Log::PrintErr("Error WSAAddressToString: %d\n", WSAGetLastError());
return false;
}
return true;

Powered by Google App Engine
This is Rietveld 408576698