michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #include "SkTypes.h" michael@0: #include michael@0: michael@0: static const size_t kBufferSize = 256; michael@0: michael@0: #define LOG_TAG "skia" michael@0: #include michael@0: michael@0: static bool gSkDebugToStdOut = false; michael@0: michael@0: extern "C" void AndroidSkDebugToStdOut(bool debugToStdOut) { michael@0: gSkDebugToStdOut = debugToStdOut; michael@0: } michael@0: michael@0: void SkDebugf(const char format[], ...) { michael@0: va_list args; michael@0: va_start(args, format); michael@0: __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args); michael@0: michael@0: // Print debug output to stdout as well. This is useful for command michael@0: // line applications (e.g. skia_launcher) michael@0: if (gSkDebugToStdOut) { michael@0: vprintf(format, args); michael@0: } michael@0: michael@0: va_end(args); michael@0: }