Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
logging.h
Go to the documentation of this file.
1/*
2 This file is part of Ansel,
3 Copyright (C) 2026 Aurélien PIERRE.
4
5 Ansel is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Ansel is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Ansel. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef DT_COMMON_LOGGING_H
19#define DT_COMMON_LOGGING_H
20
21/* Debug-channel flags and the dt_print() family. The implementations live in
22 * darktable.c (they read the runtime `darktable.unmuted` mask), but the
23 * DECLARATIONS need nothing from the application: low-level compute units include
24 * this instead of darktable.h to be able to log. */
25
26#include <stdint.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
33{
34 DT_DEBUG_ALWAYS = 0, // always print regardless of debug flags
35 // powers of two, masking
38 DT_DEBUG_DEV = 1 << 2,
39 DT_DEBUG_GTK = 1 << 3,
40 DT_DEBUG_PERF = 1 << 4,
44 DT_DEBUG_SQL = 1 << 8,
47 DT_DEBUG_NAN = 1 << 11,
48 DT_DEBUG_MASKS = 1 << 12,
49 DT_DEBUG_LUA = 1 << 13,
50 DT_DEBUG_INPUT = 1 << 14,
51 DT_DEBUG_PRINT = 1 << 15,
55 DT_DEBUG_UNDO = 1 << 19,
56 DT_DEBUG_SIGNAL = 1 << 20,
57 DT_DEBUG_PARAMS = 1 << 21,
60 DT_DEBUG_TILING = 1 << 24,
62 DT_DEBUG_PIPE = 1 << 26,
63 DT_DEBUG_IMPORT = 1 << 27,
68
69// Uses the top (sign) bit of the int32_t `unmuted` mask. Defined as a macro
70// because 1 << 31 is not representable as an `int` enumerator. Enables the
71// high-level event supervisor (NDJSON tracing of history/pipeline/cache state).
72// See develop/supervisor.h.
73#define DT_DEBUG_SUPERVISOR ((int32_t)(1u << 31))
74
75/* Runtime debug-channel mask (the application's `darktable.unmuted`). Accessor
76 * declared here, implemented by the orchestrator (darktable.c, next to
77 * dt_print()) so header inlines can gate on debug channels without importing
78 * the application struct. Test with `dt_get_debug_flags() & DT_DEBUG_XXX`. */
79int32_t dt_get_debug_flags(void);
80
81void dt_print(dt_debug_thread_t thread, const char *msg, ...) __attribute__((format(printf, 2, 3)));
82/* same as above but without time stamp : nts = no time stamp */
83void dt_print_nts(dt_debug_thread_t thread, const char *msg, ...) __attribute__((format(printf, 2, 3)));
84/* same as above but requires additional DT_DEBUG_VERBOSE flag to be true */
85void dt_vprint(dt_debug_thread_t thread, const char *msg, ...) __attribute__((format(printf, 2, 3)));
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif // DT_COMMON_LOGGING_H
92
93// clang-format off
94// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
95// vim: shiftwidth=2 expandtab tabstop=2 cindent
96// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
97// clang-format on
dt_debug_thread_t
Definition logging.h:33
@ DT_DEBUG_LIGHTTABLE
Definition logging.h:46
@ DT_DEBUG_UNDO
Definition logging.h:55
@ DT_DEBUG_INPUT
Definition logging.h:50
@ DT_DEBUG_PRINT
Definition logging.h:51
@ DT_DEBUG_OPENCL
Definition logging.h:43
@ DT_DEBUG_GTK
Definition logging.h:39
@ DT_DEBUG_PIPE
Definition logging.h:62
@ DT_DEBUG_PIPECACHE
Definition logging.h:41
@ DT_DEBUG_HISTORY
Definition logging.h:61
@ DT_DEBUG_CAMERA_SUPPORT
Definition logging.h:52
@ DT_DEBUG_NAN
Definition logging.h:47
@ DT_DEBUG_DEMOSAIC
Definition logging.h:58
@ DT_DEBUG_MEMORY
Definition logging.h:45
@ DT_DEBUG_PERF
Definition logging.h:40
@ DT_DEBUG_VERBOSE
Definition logging.h:64
@ DT_DEBUG_PARAMS
Definition logging.h:57
@ DT_DEBUG_CONTROL
Definition logging.h:37
@ DT_DEBUG_COLORPROFILE
Definition logging.h:65
@ DT_DEBUG_CACHE
Definition logging.h:36
@ DT_DEBUG_ALWAYS
Definition logging.h:34
@ DT_DEBUG_SIGNAL
Definition logging.h:56
@ DT_DEBUG_PWSTORAGE
Definition logging.h:42
@ DT_DEBUG_SHORTCUTS
Definition logging.h:59
@ DT_DEBUG_IMAGEIO
Definition logging.h:54
@ DT_DEBUG_DEV
Definition logging.h:38
@ DT_DEBUG_NOCACHE_REUSE
Definition logging.h:66
@ DT_DEBUG_IMPORT
Definition logging.h:63
@ DT_DEBUG_IOPORDER
Definition logging.h:53
@ DT_DEBUG_MASKS
Definition logging.h:48
@ DT_DEBUG_TILING
Definition logging.h:60
@ DT_DEBUG_SQL
Definition logging.h:44
@ DT_DEBUG_LUA
Definition logging.h:49
int32_t dt_get_debug_flags(void)
Definition darktable.c:2075
void void dt_print_nts(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
void void void dt_vprint(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
float dt_aligned_pixel_simd_t __attribute__((vector_size(16), aligned(16)))
Apply one channel's tone curve to each of the three colour channels, or pass the channel through unto...
Definition simd.h:55