UVES Pipeline Reference Manual  5.4.0
uves_msg.h
1 /*
2  * This file is part of the ESO UVES Pipeline
3  * Copyright (C) 2004,2005 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: 2010-09-24 09:32:04 $
23  * $Revision: 1.14 $
24  * $Name: not supported by cvs2svn $
25  * $Log: not supported by cvs2svn $
26  * Revision 1.12 2006/02/28 09:15:22 jmlarsen
27  * Minor update
28  *
29  * Revision 1.11 2006/02/21 14:26:54 jmlarsen
30  * Minor changes
31  *
32  * Revision 1.10 2005/12/19 16:17:56 jmlarsen
33  * Replaced bool -> int
34  *
35  */
36 #ifndef UVES_MSG_H
37 #define UVES_MSG_H
38 
39 #include <uves_utils.h>
40 
41 /* Nothing bad happens if user also calls cpl_msg_info()
42  * but maybe prevent it as a service to the user of this module
43 #define cpl_msg_info(...) use__uves_msg__instead__of__cpl_msg_info
44 #define cpl_msg_indent()
45  */
46 
47 /*----------------------------------------------------------------------------*/
52 /*----------------------------------------------------------------------------*/
55 /*----------------------------------------------------------------------------*/
63 /*----------------------------------------------------------------------------*/
64 #define uves_msg_error(...) cpl_msg_error(__func__, __VA_ARGS__)
65 
66 /*----------------------------------------------------------------------------*/
76 /*----------------------------------------------------------------------------*/
77 #define uves_msg_progress(i, iter, ...) cpl_msg_progress(__func__, (i), (iter), __VA_ARGS__)
78 /*----------------------------------------------------------------------------*/
86 /*----------------------------------------------------------------------------*/
87 #define uves_msg_warning(...) uves_msg_warning_macro(__func__, __VA_ARGS__)
88 /*----------------------------------------------------------------------------*/
96 /*----------------------------------------------------------------------------*/
97 #define uves_msg_debug(...) cpl_msg_debug(__func__, __VA_ARGS__)
98 
99 /*----------------------------------------------------------------------------*/
104 /*----------------------------------------------------------------------------*/
105 #define uves_msg_low(...) do { \
106  uves_msg_softer(); \
107  uves_msg(__VA_ARGS__); \
108  uves_msg_louder(); \
109  } while (false)
110 
111 /*----------------------------------------------------------------------------*/
118 /*----------------------------------------------------------------------------*/
119 #define uves_msg(...) uves_msg_macro(__func__, __VA_ARGS__)
120 
121 /*----------------------------------------------------------------------------*/
125 /*----------------------------------------------------------------------------*/
126 #define uves_msg_softer() uves_msg_softer_macro(__func__)
127 
128 /*----------------------------------------------------------------------------*/
132 /*----------------------------------------------------------------------------*/
133 #define uves_msg_louder() uves_msg_louder_macro(__func__)
134 
135 
136 void uves_msg_init(int olevel, const char *dom);
137 
138 
139 void uves_msg_set_level(int olevel);
140 
141 const char *uves_msg_get_domain(void);
142 void uves_msg_set_domain(const char *d);
143 void uves_msg_macro(const char *fct, const char *format, ...)
144 #ifdef __GNUC__
145 __attribute__((format (printf, 2, 3)))
146 #endif
147 ;
148 
149 void uves_msg_warning_macro(const char *fct, const char *format, ...)
150 #ifdef __GNUC__
151 __attribute__((format (printf, 2, 3)))
152 #endif
153 ;
154 
155 int uves_msg_get_warnings(void);
156 void uves_msg_add_warnings(int n);
157 
158 void uves_msg_softer_macro(const char *fct);
159 void uves_msg_louder_macro(const char *fct);
160 
161 #endif /* UVES_MSG_H */
162