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

Unified Diff: runtime/bin/process_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/process_win.cc
===================================================================
--- runtime/bin/process_win.cc (revision 14903)
+++ runtime/bin/process_win.cc (working copy)
@@ -7,6 +7,7 @@
#include "bin/builtin.h"
#include "bin/process.h"
#include "bin/eventhandler.h"
+#include "bin/log.h"
#include "bin/thread.h"
#include "bin/utils.h"
#include "platform/globals.h"
@@ -221,7 +222,7 @@
NULL);
if (handles[kWriteHandle] == INVALID_HANDLE_VALUE) {
- fprintf(stderr, "CreateNamedPipe failed %d\n", GetLastError());
+ Log::PrintErr("CreateNamedPipe failed %d\n", GetLastError());
return false;
}
@@ -234,7 +235,7 @@
FILE_READ_ATTRIBUTES | FILE_FLAG_OVERLAPPED,
NULL);
if (handles[kReadHandle] == INVALID_HANDLE_VALUE) {
- fprintf(stderr, "CreateFile failed %d\n", GetLastError());
+ Log::PrintErr("CreateFile failed %d\n", GetLastError());
return false;
}
} else {
@@ -250,7 +251,7 @@
NULL);
if (handles[kReadHandle] == INVALID_HANDLE_VALUE) {
- fprintf(stderr, "CreateNamedPipe failed %d\n", GetLastError());
+ Log::PrintErr("CreateNamedPipe failed %d\n", GetLastError());
return false;
}
@@ -263,7 +264,7 @@
FILE_WRITE_ATTRIBUTES | FILE_FLAG_OVERLAPPED,
NULL);
if (handles[kWriteHandle] == INVALID_HANDLE_VALUE) {
- fprintf(stderr, "CreateFile failed %d\n", GetLastError());
+ Log::PrintErr("CreateFile failed %d\n", GetLastError());
return false;
}
}
@@ -275,7 +276,7 @@
for (int i = kReadHandle; i < kWriteHandle; i++) {
if (handles[i] != INVALID_HANDLE_VALUE) {
if (!CloseHandle(handles[i])) {
- fprintf(stderr, "CloseHandle failed %d\n", GetLastError());
+ Log::PrintErr("CloseHandle failed %d\n", GetLastError());
}
handles[i] = INVALID_HANDLE_VALUE;
}
@@ -306,7 +307,7 @@
NULL);
if (message_size == 0) {
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
- fprintf(stderr, "FormatMessage failed %d\n", GetLastError());
+ Log::PrintErr("FormatMessage failed %d\n", GetLastError());
}
snprintf(os_error_message, os_error_message_len, "OS Error %d", error_code);
}
@@ -338,14 +339,14 @@
UUID uuid;
RPC_STATUS status = UuidCreateSequential(&uuid);
if (status != RPC_S_OK && status != RPC_S_UUID_LOCAL_ONLY) {
- fprintf(stderr, "UuidCreateSequential failed %d\n", status);
+ Log::PrintErr("UuidCreateSequential failed %d\n", status);
SetOsErrorMessage(os_error_message, os_error_message_len);
return status;
}
RPC_CSTR uuid_string;
status = UuidToString(&uuid, &uuid_string);
if (status != RPC_S_OK) {
- fprintf(stderr, "UuidToString failed %d\n", status);
+ Log::PrintErr("UuidToString failed %d\n", status);
SetOsErrorMessage(os_error_message, os_error_message_len);
return status;
}
@@ -357,7 +358,7 @@
}
status = RpcStringFree(&uuid_string);
if (status != RPC_S_OK) {
- fprintf(stderr, "RpcStringFree failed %d\n", status);
+ Log::PrintErr("RpcStringFree failed %d\n", status);
SetOsErrorMessage(os_error_message, os_error_message_len);
return status;
}

Powered by Google App Engine
This is Rietveld 408576698