2 * Copyright 2022 Google LLC
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef skgpu_graphite_Log_DEFINED
9 #define skgpu_graphite_Log_DEFINED
11 namespace skgpu::graphite {
12 enum class Priority : int {
17 }; // namespace skgpu::graphite
19 #if !defined(SKGPU_LOWEST_ACTIVE_PRIORITY)
21 #define SKGPU_LOWEST_ACTIVE_PRIORITY Priority::kWarning
23 #define SKGPU_LOWEST_ACTIVE_PRIORITY Priority::kError
26 #define SKGPU_LOG(priority, fmt, ...) \
28 if (priority <= SKGPU_LOWEST_ACTIVE_PRIORITY) { \
29 SkDebugf("[graphite] " fmt "\n", ##__VA_ARGS__); \
32 #define SKGPU_LOG_E(fmt, ...) SKGPU_LOG(Priority::kError, "** ERROR ** " fmt, ##__VA_ARGS__)
33 #define SKGPU_LOG_W(fmt, ...) SKGPU_LOG(Priority::kWarning, "WARNING - " fmt, ##__VA_ARGS__)
34 #define SKGPU_LOG_D(fmt, ...) SKGPU_LOG(Priority::kDebug, fmt, ##__VA_ARGS__)
36 #endif // skgpu_graphite_Log_DEFINED