yast2-core
Y2Logger.h
Go to the documentation of this file.
1 /* Y2Logger.h
2  *
3  * Macros for logging the output.
4  *
5  * Just #include "Y2Logger.h" and use Y2_DEBUG, Y2_WARNING or Y2_ERROR
6  *
7  * If you write Y2_DEBUG("Hello: %d",7) on line 13 in the file Source.cc,
8  * the debug output will look like this:
9  * [...]:Source.cc[13] Hello: 7
10  *
11  * Additionally you can #define Y2_COMPONENT before inclusion and its name
12  * will be put just before the Source.cc.
13  * And don't forget set (end export the Y2DEBUG shell variable!
14  *
15  * Also define Y2_DEBUG_YES if you want to get the debugging output!
16  *
17  * Author: Michal Svec <msvec@suse.cz>
18  * Daniel Vesely <dan@suse.cz>
19  *
20  * $Id$
21  */
22 
23 #ifndef Y2Logger_h
24 #define Y2Logger_h
25 
26 #include <ycp/y2log.h>
27 
28 /*
29  * Log the error and return ...
30  */
31 #define Y2_RETURN_FALSE(format,args...) \
32  do { ycp2error(format,##args); return false; } while(0)
33 
34 #define Y2_RETURN_VOID(format,args...) \
35  do { ycp2error(format,##args); return YCPNull(); } while(0)
36 
37 #define Y2_RETURN_STR(format,args...) \
38  do { ycp2error(format,##args); return ""; } while(0)
39 
40 #define Y2_RETURN_YCP_FALSE(format,args...) \
41  do { ycp2error(format,##args); return YCPBoolean(false); } while(0)
42 
43 #endif /* Y2Logger_h */

Generated on a sunny day for yast2-core by doxygen 1.8.11