SINFONI Pipeline Reference Manual  2.5.2
sinfo_msg.h
1 /*
2  * This file is part of the ESO SINFO 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: 2006-11-21 11:56:10 $
23  * $Revision: 1.2 $
24  * $Name: not supported by cvs2svn $
25  */
26 #ifndef SINFO_MSG_H
27 #define SINFO_MSG_H
28 
29 /*
30 #include <sinfo_utils.h>
31 */
32 #include <cpl_msg.h>
33 
34 /* Nothing bad happens if user also calls cpl_msg_info()
35  * but prevent it as a service to the user of this module
36 #define cpl_msg_info(...) use__sinfo_msg__instead__of__cpl_msg_info
37 #define cpl_msg_indent()
38  */
39 
40 /*----------------------------------------------------------------------------*/
45 /*----------------------------------------------------------------------------*/
49 void sinfo_msg_init(int outlevel, const char *dom);
50 
51 
52 void sinfo_msg_set_level(int olevel);
53 
54 const char *sinfo_msg_get_domain(void);
55 void sinfo_msg_set_domain(const char *d);
56 
57 
58 /* Convenience macros to save the user from typing function id */
59 
60 /*----------------------------------------------------------------------------*/
68 /*----------------------------------------------------------------------------*/
69 #define sinfo_msg_error(...) cpl_msg_error(cpl_func, __VA_ARGS__)
70 
71 /*----------------------------------------------------------------------------*/
81 /*----------------------------------------------------------------------------*/
82 #define sinfo_msg_progress(i, iter, ...) \
83  cpl_msg_progress(cpl_func, (i), (iter), __VA_ARGS__)
84 /*----------------------------------------------------------------------------*/
92 /*----------------------------------------------------------------------------*/
93 #define sinfo_msg_warning(...) sinfo_msg_warning_macro(cpl_func, __VA_ARGS__)
94 /*----------------------------------------------------------------------------*/
102 /*----------------------------------------------------------------------------*/
103 #define sinfo_msg_debug(...) cpl_msg_debug(cpl_func, __VA_ARGS__)
104 
105 /*----------------------------------------------------------------------------*/
110 /*----------------------------------------------------------------------------*/
111 #define sinfo_msg_low(...) do { \
112  sinfo_msg_softer(); \
113  sinfo_msg(__VA_ARGS__); \
114  sinfo_msg_louder(); \
115  } while (FALSE)
116 
117 
118 
119 
120 #define sinfo_msg(...) sinfo_msg_macro(cpl_func, __VA_ARGS__)
121 #define sinfo_msg_softer() sinfo_msg_softer_macro(cpl_func)
122 #define sinfo_msg_louder() sinfo_msg_louder_macro(cpl_func)
123 
124 
125 void sinfo_msg_macro(const char *fct, const char *format, ...)
126 #ifdef __GNUC__
127 __attribute__((format (printf, 2, 3)))
128 #endif
129 ;
130 
131 void sinfo_msg_warning_macro(const char *fct, const char *format, ...)
132 #ifdef __GNUC__
133 __attribute__((format (printf, 2, 3)))
134 #endif
135 ;
136 
137 int sinfo_msg_get_warnings(void);
138 void sinfo_msg_add_warnings(int n);
139 
140 void sinfo_msg_softer_macro(const char *fct);
141 void sinfo_msg_louder_macro(const char *fct);
142 
143 #endif /* SINFO_MSG_H */
144