unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 4a096945468692eb284c1215653e5b20797abbd9 1893 bytes (raw)
name: util/debug_print.h 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 
/* debug_print.h - Provide the INTERNAL_ERROR and DEBUG_PRINTF macros
 *
 * Copyright © 2009 Carl Worth
 * Copyright © 2018 David Bremner
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/ .
 *
 * Author: Carl Worth <cworth@cworth.org>
 */

#ifndef DEBUG_PRINT_H
#define DEBUG_PRINT_H

#include <talloc.h>
#include "function-attributes.h"

void
_debug_printf (const char *format, ...) PRINTF_ATTRIBUTE (1, 2);

/*
 * Provide a quick way to silence debugging output.
 */

#ifdef DEBUG_PRINT
#define DEBUG_PRINTF(format, ...) _debug_printf(format " (%s).\n",	\
						##__VA_ARGS__, __location__)
#else
#define DEBUG_PRINTF(format, ...) /* ignored */
#endif

/* There's no point in continuing when we've detected that we've done
 * something wrong internally (as opposed to the user passing in a
 * bogus value).
 *
 * Note that PRINTF_ATTRIBUTE comes from talloc.h
 */
void
_internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2) NORETURN_ATTRIBUTE;

/* There's no point in continuing when we've detected that we've done
 * something wrong internally (as opposed to the user passing in a
 * bogus value).
 *
 * Note that __location__ comes from talloc.h.
 */
#define INTERNAL_ERROR(format, ...)			\
    _internal_error (format " (%s).\n",			\
		     ##__VA_ARGS__, __location__)

#endif

debug log:

solving 4a096945 ...
found 4a096945 in https://yhetil.org/notmuch/20180830112915.11761-2-david@tethera.net/ ||
	https://yhetil.org/notmuch/20180730224555.26047-2-david@tethera.net/ ||
	https://yhetil.org/notmuch/20180720233746.2844-2-david@tethera.net/
found 4bb338a2 in https://yhetil.org/notmuch.git/
preparing index
index prepared:
100644 4bb338a2abeacd1253c1287c39f8d6769e1c5405	util/error_util.h

applying [1/1] https://yhetil.org/notmuch/20180830112915.11761-2-david@tethera.net/
diff --git a/util/error_util.h b/util/debug_print.h
similarity index 75%
rename from util/error_util.h
rename to util/debug_print.h
index 4bb338a2..4a096945 100644

Checking patch util/error_util.h => util/debug_print.h...
Applied patch util/error_util.h => util/debug_print.h cleanly.

skipping https://yhetil.org/notmuch/20180730224555.26047-2-david@tethera.net/ for 4a096945
skipping https://yhetil.org/notmuch/20180720233746.2844-2-david@tethera.net/ for 4a096945
index at:
100644 4a096945468692eb284c1215653e5b20797abbd9	util/debug_print.h

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).