X-shooter Pipeline Reference Manual 3.8.15
xsh_msg.h
Go to the documentation of this file.
1/*
2 * This file is part of the ESO X-shooter Pipeline
3 * Copyright (C) 2006 European Southern Observatory
4 *
5 * This program 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 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program 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 this program; if not, write to the Free Software
17 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
18 */
19
20/*
21 * $Author: amodigli $
22 * $Date: 2011-12-02 14:15:28 $
23 * $Revision: 1.8 $
24 * $Name: not supported by cvs2svn $
25 */
26#ifndef XSH_MSG_H
27#define XSH_MSG_H
28
29#include <xsh_utils.h>
30
31#include <stdbool.h>
32
33/*----------------------------------------------------------------------------*/
38/*----------------------------------------------------------------------------*/
40#define xsh_msg_dbg_high(...) { \
41 if (xsh_debug_level_get() >= XSH_DEBUG_LEVEL_HIGH)\
42 cpl_msg_debug(__func__, __VA_ARGS__) ; \
43 }
44#define xsh_msg_dbg_medium(...) { \
45 if (xsh_debug_level_get() >= XSH_DEBUG_LEVEL_MEDIUM)\
46 cpl_msg_debug(__func__, __VA_ARGS__) ; \
47 }
48#define xsh_msg_dbg_low(...) { \
49 if (xsh_debug_level_get() >= XSH_DEBUG_LEVEL_LOW)\
50 cpl_msg_debug(__func__, __VA_ARGS__) ; \
51 }
52
53/*----------------------------------------------------------------------------*/
61/*----------------------------------------------------------------------------*/
62#define xsh_msg_error(...) cpl_msg_error(__func__, __VA_ARGS__)
63
64/*----------------------------------------------------------------------------*/
74/*----------------------------------------------------------------------------*/
75#define xsh_msg_progress(i, iter, ...) cpl_msg_progress(__func__, (i), (iter),\
76 __VA_ARGS__)
77/*----------------------------------------------------------------------------*/
87/*----------------------------------------------------------------------------*/
88#define xsh_msg_warning(...) xsh_msg_warning_macro(__func__, __VA_ARGS__)
89
90/*----------------------------------------------------------------------------*/
98/*----------------------------------------------------------------------------*/
99#define xsh_msg_debug(...) cpl_msg_debug(__func__, __VA_ARGS__)
100
101/*----------------------------------------------------------------------------*/
106/*----------------------------------------------------------------------------*/
107#define xsh_msg_indented(...) do { \
108 cpl_msg_indent_more(); \
109 xsh_msg(__VA_ARGS__); \
110 cpl_msg_indent_less(); \
111 } while (false)
112
113/*----------------------------------------------------------------------------*/
120/*----------------------------------------------------------------------------*/
121#define xsh_msg(...) cpl_msg_info("", __VA_ARGS__)
122
123void xsh_msg_init(void);
124
125void xsh_msg_warning_macro(const char *fct, const char *format, ...)
126#ifdef __GNUC__
127__attribute__((format (printf, 2, 3)))
128#endif
129;
130
131int xsh_msg_get_warnings(void);
132
133#endif /* XSH_MSG_H */
134
void xsh_msg_init(void)
Initialize messaging.
Definition: xsh_msg.c:80
void xsh_msg_warning_macro(const char *fct, const char *format,...)
Print a warning message.
Definition: xsh_msg.c:137
int xsh_msg_get_warnings(void)
Get number of warnings printed so far.
Definition: xsh_msg.c:116