1 /* 2 * Copyright 2006 The Android Open Source Project 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #include "include/core/SkTypes.h" 9 #if defined(SK_BUILD_FOR_ANDROID) 10 11 #include <stdio.h> 12 13 #ifdef LOG_TAG 14 #undef LOG_TAG 15 #endif 16 #define LOG_TAG "skia" 17 #include <android/log.h> 18 19 // Print debug output to stdout as well. This is useful for command line 20 // applications (e.g. skia_launcher). 21 bool gSkDebugToStdOut = false; 22 SkDebugf(const char format[],...)23void SkDebugf(const char format[], ...) { 24 va_list args1, args2; 25 va_start(args1, format); 26 27 if (gSkDebugToStdOut) { 28 va_copy(args2, args1); 29 vprintf(format, args2); 30 va_end(args2); 31 } 32 33 __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args1); 34 35 va_end(args1); 36 } 37 38 #endif//defined(SK_BUILD_FOR_ANDROID) 39