Mercurial > hg > fxanalyse
comparison logging.h @ 169:97112b45b838
Get Sr data logger parameters from configuration file. Code reorganization.
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Fri, 14 Feb 2014 16:58:19 +0100 |
parents | |
children | 111610d871af |
comparison
equal
deleted
inserted
replaced
168:4de7f2c9f328 | 169:97112b45b838 |
---|---|
1 #ifndef __LOGGING_H__ | |
2 #define __LOGGING_H__ | |
3 | |
4 /* required for the user interface defines */ | |
5 #include "FXAnalyse.h" | |
6 #include "utils.h" | |
7 | |
8 struct logger { | |
9 unsigned int panel; | |
10 int fd; | |
11 } __logger; | |
12 | |
13 enum loglevel { | |
14 DEBUG, | |
15 INFO, | |
16 WARNING, | |
17 ERROR, | |
18 }; | |
19 | |
20 int __logger_init(struct logger *l); | |
21 void __logmessage(struct logger *l, enum loglevel level, const char *frmt, ...); | |
22 | |
23 #define logger_init() __logger_init(&__logger) | |
24 #define logmessage(level, msg, ...) __logmessage(&__logger, (level), (msg), ##__VA_ARGS__) | |
25 #define logmsg(msg, ...) __logmessage(&__logger, INFO, msg, ##__VA_ARGS__) | |
26 #define logger_panel_visible(visible) SetPanelAttribute(__logger.panel, ATTR_VISIBLE, visible) | |
27 | |
28 #endif |