• 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  * 2023.4.26 log adapt ohos.
7  * Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
8  */
9 
10 #include "include/core/SkTypes.h"
11 #include <stdio.h>
12 
13 #define LOG_TAG "skia"
14 #include "hilog/log.h"
15 
16 extern "C" {
17     int HiLogPrintArgs(LogType type, LogLevel level, unsigned int domain, const char* tag, const char* fmt, va_list ap);
18 }
19 
20 // Print debug output to stdout as well.  This is useful for command line
21 // applications (e.g. skia_launcher).
22 bool gSkDebugToStdOut = false;
23 
SkDebugf(const char format[],...)24 void SkDebugf(const char format[], ...) {
25     va_list args1, args2;
26     va_start(args1, format);
27 
28     if (gSkDebugToStdOut) {
29         va_copy(args2, args1);
30         vprintf(format, args2);
31         va_end(args2);
32     }
33 
34     HiLogPrintArgs(LOG_CORE, LogLevel::LOG_DEBUG, 0xD001406, LOG_TAG, format, args1);
35 
36     va_end(args1);
37 }