1 /* evilwm - Minimalist Window Manager for X
2 * Copyright (C) 1999-2007 Ciaran Anscomb <evilwm@6809.org.uk>
3 * see README for license and other details. */
8 #if defined(STDIO) || defined(DEBUG) || defined(XDEBUG)
13 extern int log_indent
;
17 # define LOG_INFO(...) printf(__VA_ARGS__);
18 # define LOG_ERROR(...) fprintf(stderr, __VA_ARGS__);
20 # define LOG_INFO(...)
21 # define LOG_ERROR(...)
25 # define LOG_INDENT() do { int ii; for (ii = 0; ii < log_indent; ii++) fprintf(stderr, " "); } while (0)
26 # define LOG_ENTER(...) do { LOG_INDENT(); log_indent++; fprintf(stderr, __VA_ARGS__); fprintf(stderr, " at %s:%d\n", __FILE__, __LINE__); } while (0)
27 # define LOG_LEAVE() do { if (log_indent > 0) log_indent--; } while (0)
28 # define LOG_DEBUG(...) do { LOG_INDENT(); fprintf(stderr, __VA_ARGS__); } while (0)
29 # define LOG_DEBUG_(...) fprintf(stderr, __VA_ARGS__)
31 # define LOG_ENTER(...)
32 # define LOG_LEAVE(...)
33 # define LOG_DEBUG(...)
34 # define LOG_DEBUG_(...)
38 # define LOG_XENTER(...) LOG_ENTER(__VA_ARGS__)
39 # define LOG_XLEAVE(...) LOG_LEAVE(__VA_ARGS__)
40 # define LOG_XDEBUG(...) LOG_DEBUG(__VA_ARGS__)
41 # define LOG_XDEBUG_(...) LOG_DEBUG_(__VA_ARGS__)
43 # define LOG_XENTER(...)
44 # define LOG_XLEAVE(...)
45 # define LOG_XDEBUG(...)
46 # define LOG_XDEBUG_(...)
49 #endif /* __LOG_H__ */