| OLD | NEW |
| 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 |
| OLD | NEW |