summaryrefslogtreecommitdiff
path: root/pith/debug.h
blob: 230ec642d7f453081a805c3eb5f4fae50b969cdc (plain)
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
/*
 * $Id: debug.h 761 2007-10-23 22:35:18Z hubert@u.washington.edu $
 *
 * ========================================================================
 * Copyright 2013-2022 Eduardo Chappa
 * Copyright 2006 University of Washington
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * ========================================================================
 */

#ifndef PITH_DEBUG_INCLUDED
#define PITH_DEBUG_INCLUDED


/*======================================================================
       Macros for debug printfs 
   n is debugging level:
       1 logs only highest level events and errors
       2 logs events like file writes
       3
       4 logs each command
       5
       6 
       7 logs details of command execution (7 is highest to run any production)
         allows core dumps without cleaning up terminal modes
       8
       9 logs gross details of command execution
    
  ====*/


#ifdef DEBUG

#define   dprint(x)	{ output_debug_msg x ; }

/* global debugging level */
extern int debug;

/* mandatory to implement stubs */
void	output_debug_msg(int, char *fmt, ...);
void	dump_configuration(int);
void	dump_contexts(void);



#else	/* !DEBUG */

#define   dprint(x)

#endif	/* !DEBUG */


#endif /* PITH_DEBUG_INCLUDED */