Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
graphite
Log.h
Go to the documentation of this file.
1
/*
2
* Copyright 2022 Google LLC
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
#ifndef skgpu_graphite_Log_DEFINED
9
#define skgpu_graphite_Log_DEFINED
10
11
namespace
skgpu::graphite
{
12
enum class
Priority
:
int
{
13
kFatal
= 0,
14
kError
= 1,
15
kWarning
= 2,
16
kDebug
= 3,
17
};
18
};
// namespace skgpu::graphite
19
20
#if !defined(SKGPU_LOWEST_ACTIVE_PRIORITY)
21
#ifdef SK_DEBUG
22
#define SKGPU_LOWEST_ACTIVE_PRIORITY skgpu::graphite::Priority::kWarning
23
#else
24
#define SKGPU_LOWEST_ACTIVE_PRIORITY skgpu::graphite::Priority::kError
25
#endif
26
#endif
27
#define SKGPU_LOG(priority, fmt, ...) \
28
do { \
29
if (priority <= SKGPU_LOWEST_ACTIVE_PRIORITY) { \
30
SkDebugf("[graphite] " fmt "\n", ##__VA_ARGS__); \
31
if (priority == skgpu::graphite::Priority::kFatal) { \
32
SK_ABORT("Fatal log call"); \
33
} \
34
} \
35
} while (0)
36
#define SKGPU_LOG_F(fmt, ...) SKGPU_LOG(skgpu::graphite::Priority::kFatal, "** ERROR ** " fmt, \
37
##__VA_ARGS__)
38
#define SKGPU_LOG_E(fmt, ...) SKGPU_LOG(skgpu::graphite::Priority::kError, "** ERROR ** " fmt, \
39
##__VA_ARGS__)
40
#define SKGPU_LOG_W(fmt, ...) SKGPU_LOG(skgpu::graphite::Priority::kWarning, "WARNING - " fmt, \
41
##__VA_ARGS__)
42
#define SKGPU_LOG_D(fmt, ...) SKGPU_LOG(skgpu::graphite::Priority::kDebug, fmt, \
43
##__VA_ARGS__)
44
45
#endif
// skgpu_graphite_Log_DEFINED
skgpu::graphite
Definition
BoundsManagerBench.cpp:27
skgpu::graphite::BuiltInCodeSnippetID::kError
@ kError
skgpu::graphite::Priority
Priority
Definition
Log.h:12
skgpu::graphite::Priority::kDebug
@ kDebug
skgpu::graphite::Priority::kFatal
@ kFatal
skgpu::graphite::Priority::kWarning
@ kWarning
Generated on Fri Apr 26 2024 06:17:18 for Flutter Engine by
1.9.8