diff options
author | Brian Paul <[email protected]> | 2012-05-22 09:32:50 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-05-25 10:02:21 -0600 |
commit | 9c8568743935f0892bb5bd33f5a5210bae53b8d3 (patch) | |
tree | 19d299308de55193e05fe5af9c019710abb980c8 /src/gallium/auxiliary/util | |
parent | ab014adaed14a9ca213447dc913d0dce7906be56 (diff) |
util: add GALLIUM_LOG_FILE option for logging output to a file
Useful for logging different runs to files and diffing, etc.
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_debug.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index df1d8e68cfd..0a350cae7dd 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -48,9 +48,9 @@ void _debug_vprintf(const char *format, va_list ap) { + static char buf[4096] = {'\0'}; #if defined(PIPE_OS_WINDOWS) || defined(PIPE_SUBSYSTEM_EMBEDDED) /* We buffer until we find a newline. */ - static char buf[4096] = {'\0'}; size_t len = strlen(buf); int ret = util_vsnprintf(buf + len, sizeof(buf) - len, format, ap); if(ret > (int)(sizeof(buf) - len - 1) || util_strchr(buf + len, '\n')) { @@ -58,8 +58,8 @@ void _debug_vprintf(const char *format, va_list ap) buf[0] = '\0'; } #else - /* Just print as-is to stderr */ - vfprintf(stderr, format, ap); + util_vsnprintf(buf, sizeof(buf), format, ap); + os_log_message(buf); #endif } |