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
48{
49 DT_DEBUG_ALWAYS = 0, // always print regardless of debug flags
50 // powers of two, masking
53 DT_DEBUG_DEV = 1 << 2,
54 DT_DEBUG_GTK = 1 << 3,
55 DT_DEBUG_PERF = 1 << 4,
58 DT_DEBUG_SQL = 1 << 8,
61 DT_DEBUG_NAN = 1 << 11,
62 DT_DEBUG_MASKS = 1 << 12,
63 DT_DEBUG_LUA = 1 << 13,
64 DT_DEBUG_INPUT = 1 << 14,
65 DT_DEBUG_PRINT = 1 << 15,
69 DT_DEBUG_UNDO = 1 << 19,
70 DT_DEBUG_SIGNAL = 1 << 20,
71 DT_DEBUG_PARAMS = 1 << 21,
74 DT_DEBUG_TILING = 1 << 24,
76 DT_DEBUG_PIPE = 1 << 26,
77 DT_DEBUG_IMPORT = 1 << 27,
82
83// Uses the top (sign) bit of the int32_t `unmuted` mask. Defined as a macro
84// because 1 << 31 is not representable as an `int` enumerator. Enables the
85// high-level event supervisor (NDJSON tracing of history/pipeline/cache state).
86// See develop/supervisor.h.
87#define DT_DEBUG_SUPERVISOR ((int32_t)(1u << 31))
88
89/* Runtime debug-channel mask (the application's `darktable.unmuted`). Accessor
90 * declared here, implemented by the orchestrator (darktable.c, next to
91 * dt_print()) so header inlines can gate on debug channels without importing
92 * the application struct. Test with `dt_get_debug_flags() & DT_DEBUG_XXX`. */
93int32_t dt_get_debug_flags(void);
94
110void dt_print(dt_debug_thread_t thread, const char *msg, ...) __attribute__((format(printf, 2, 3)));
111
113void dt_print_nts(dt_debug_thread_t thread, const char *msg, ...) __attribute__((format(printf, 2, 3)));
114
119void dt_vprint(dt_debug_thread_t thread, const char *msg, ...) __attribute__((format(printf, 2, 3)));
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif // DT_COMMON_LOGGING_H
126
127// clang-format off
128// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
129// vim: shiftwidth=2 expandtab tabstop=2 cindent
130// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
131// clang-format on
dt_debug_thread_t
Debug channels, selected at runtime with -d <channel>.
Definition logging.h:48
@ DT_DEBUG_LIGHTTABLE
Definition logging.h:60
@ DT_DEBUG_UNDO
Definition logging.h:69
@ DT_DEBUG_INPUT
Definition logging.h:64
@ DT_DEBUG_PRINT
Definition logging.h:65
@ DT_DEBUG_OPENCL
Definition logging.h:57
@ DT_DEBUG_GTK
Definition logging.h:54
@ DT_DEBUG_PIPE
Definition logging.h:76
@ DT_DEBUG_PIPECACHE
Definition logging.h:56
@ DT_DEBUG_HISTORY
Definition logging.h:75
@ DT_DEBUG_CAMERA_SUPPORT
Definition logging.h:66
@ DT_DEBUG_NAN
Definition logging.h:61
@ DT_DEBUG_DEMOSAIC
Definition logging.h:72
@ DT_DEBUG_MEMORY
Definition logging.h:59
@ DT_DEBUG_PERF
Definition logging.h:55
@ DT_DEBUG_VERBOSE
Definition logging.h:78
@ DT_DEBUG_PARAMS
Definition logging.h:71
@ DT_DEBUG_CONTROL
Definition logging.h:52
@ DT_DEBUG_COLORPROFILE
Definition logging.h:79
@ DT_DEBUG_CACHE
Definition logging.h:51
@ DT_DEBUG_ALWAYS
Definition logging.h:49
@ DT_DEBUG_SIGNAL
Definition logging.h:70
@ DT_DEBUG_SHORTCUTS
Definition logging.h:73
@ DT_DEBUG_IMAGEIO
Definition logging.h:68
@ DT_DEBUG_DEV
Definition logging.h:53
@ DT_DEBUG_NOCACHE_REUSE
Definition logging.h:80
@ DT_DEBUG_IMPORT
Definition logging.h:77
@ DT_DEBUG_IOPORDER
Definition logging.h:67
@ DT_DEBUG_MASKS
Definition logging.h:62
@ DT_DEBUG_TILING
Definition logging.h:74
@ DT_DEBUG_SQL
Definition logging.h:58
@ DT_DEBUG_LUA
Definition logging.h:63
int32_t dt_get_debug_flags(void)
Definition darktable.c:2094
void void dt_print_nts(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
dt_print() without the timestamp prefix (nts = no time stamp).
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
Print to stdout when thread is enabled, prefixed with seconds since startup.
void void void dt_vprint(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
dt_print() that additionally requires DT_DEBUG_VERBOSE to be enabled, i.e. both -d <channel> and -d v...
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