• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "SkTypes.h"
9 #include <stdio.h>
10 
11 #define LOG_TAG "skia"
12 #include <android/log.h>
13 
14 // Print debug output to stdout as well.  This is useful for command line
15 // applications (e.g. skia_launcher). To enable, include android_output as a
16 // gyp dependency.
17 bool gSkDebugToStdOut = false;
18 
SkDebugf(const char format[],...)19 void SkDebugf(const char format[], ...) {
20     va_list args1, args2;
21     va_start(args1, format);
22 
23     if (gSkDebugToStdOut) {
24         va_copy(args2, args1);
25         vprintf(format, args2);
26         va_end(args2);
27     }
28 
29     __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args1);
30 
31     va_end(args1);
32 }
33