00001 /* 00002 * This file is part of the ESO X-shooter Pipeline 00003 * Copyright (C) 2006 European Southern Observatory 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA 00018 */ 00019 00020 /* 00021 * $Author: rhaigron $ 00022 * $Date: 2010/10/20 11:57:20 $ 00023 * $Revision: 1.7 $ 00024 * $Name: HEAD $ 00025 */ 00026 #ifndef XSH_MSG_H 00027 #define XSH_MSG_H 00028 00029 #include <xsh_utils.h> 00030 00031 #include <stdbool.h> 00032 00033 /*----------------------------------------------------------------------------*/ 00038 /*----------------------------------------------------------------------------*/ 00040 #define xsh_msg_dbg_high(...) { \ 00041 if (xsh_debug_level_get() >= XSH_DEBUG_LEVEL_HIGH)\ 00042 cpl_msg_debug(__func__, __VA_ARGS__) ; \ 00043 } 00044 #define xsh_msg_dbg_medium(...) { \ 00045 if (xsh_debug_level_get() >= XSH_DEBUG_LEVEL_MEDIUM)\ 00046 cpl_msg_debug(__func__, __VA_ARGS__) ; \ 00047 } 00048 #define xsh_msg_dbg_low(...) { \ 00049 if (xsh_debug_level_get() >= XSH_DEBUG_LEVEL_LOW)\ 00050 cpl_msg_debug(__func__, __VA_ARGS__) ; \ 00051 } 00052 00053 /*----------------------------------------------------------------------------*/ 00061 /*----------------------------------------------------------------------------*/ 00062 #define xsh_msg_error(...) cpl_msg_error(__func__, __VA_ARGS__) 00063 00064 /*----------------------------------------------------------------------------*/ 00074 /*----------------------------------------------------------------------------*/ 00075 #define xsh_msg_progress(i, iter, ...) cpl_msg_progress(__func__, (i), (iter),\ 00076 __VA_ARGS__) 00077 /*----------------------------------------------------------------------------*/ 00087 /*----------------------------------------------------------------------------*/ 00088 #define xsh_msg_warning(...) xsh_msg_warning_macro(__func__, __VA_ARGS__) 00089 00090 /*----------------------------------------------------------------------------*/ 00098 /*----------------------------------------------------------------------------*/ 00099 #define xsh_msg_debug(...) cpl_msg_debug(__func__, __VA_ARGS__) 00100 00101 /*----------------------------------------------------------------------------*/ 00106 /*----------------------------------------------------------------------------*/ 00107 #define xsh_msg_indented(...) do { \ 00108 cpl_msg_indent_more(); \ 00109 xsh_msg(__VA_ARGS__); \ 00110 cpl_msg_indent_less(); \ 00111 } while (false) 00112 00113 /*----------------------------------------------------------------------------*/ 00120 /*----------------------------------------------------------------------------*/ 00121 #define xsh_msg(...) cpl_msg_info("", __VA_ARGS__) 00122 00123 void xsh_msg_init(void); 00124 00125 void xsh_msg_warning_macro(const char *fct, const char *format, ...) 00126 #ifdef __GNUC__ 00127 __attribute__((format (printf, 2, 3))) 00128 #endif 00129 ; 00130 00131 int xsh_msg_get_warnings(void); 00132 00133 #endif /* XSH_MSG_H */ 00134