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

Side by Side Diff: src/shared/ppapi_proxy/utility.cc

Issue 5631003: ppapi_proxy: Make DebugPrintf more usable.... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « src/shared/ppapi_proxy/plugin_var.cc ('k') | tests/fake_browser_ppapi/fake_core.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 The Native Client Authors. All rights reserved. 2 * Copyright 2010 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file. 4 * be found in the LICENSE file.
5 */ 5 */
6 6
7 #include "native_client/src/shared/ppapi_proxy/utility.h" 7 #include "native_client/src/shared/ppapi_proxy/utility.h"
8 #include <stdarg.h> 8 #include <stdarg.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include "native_client/src/shared/platform/nacl_check.h" 10 #include "native_client/src/shared/platform/nacl_check.h"
11 #include "native_client/src/include/nacl_assert.h" 11 #include "native_client/src/include/nacl_assert.h"
12 12
13 namespace ppapi_proxy { 13 namespace ppapi_proxy {
14 14
15 const int foo = 5; 15 const int foo = 5;
16 16
17 void DebugPrintf(const char* format, ...) { 17 void DebugPrintf(const char* format, ...) {
18 static int printf_enabled = -1; 18 static int printf_enabled = -1;
19 if (printf_enabled == -1) { 19 if (printf_enabled == -1) {
20 printf_enabled = (getenv("PPAPI_BROWSER_DEBUG") != NULL); 20 printf_enabled = (getenv("PPAPI_BROWSER_DEBUG") != NULL);
21 } 21 }
22 if (printf_enabled == 1) { 22 if (printf_enabled == 1) {
23 va_list argptr; 23 va_list argptr;
24 va_start(argptr, format); 24 va_start(argptr, format);
25 vfprintf(stderr, format, argptr); 25 fprintf(stdout, "ppapi_proxy: ");
26 vfprintf(stdout, format, argptr);
26 va_end(argptr); 27 va_end(argptr);
27 fflush(stderr); 28 fflush(stdout);
28 } 29 }
29 } 30 }
30 31
31 } // namespace ppapi_proxy 32 } // namespace ppapi_proxy
OLDNEW
« no previous file with comments | « src/shared/ppapi_proxy/plugin_var.cc ('k') | tests/fake_browser_ppapi/fake_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698