annotate logging.h @ 255:ada536bc461b

Use 127.0.0.1 as example address in FXAnalyse.ini Avoid any interference with real hardware during testing
author Daniele Nicolodi <daniele@grinta.net>
date Fri, 05 Jun 2015 18:10:46 +0200
parents d948e3ced2b9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
169
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
1 #ifndef __LOGGING_H__
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
2 #define __LOGGING_H__
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
3
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
4 /* required for the user interface defines */
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
5 #include "FXAnalyse.h"
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
6 #include "utils.h"
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
7
251
307fd62f376d Implement log file rotation
Daniele Nicolodi <daniele@grinta.net>
parents: 239
diff changeset
8 struct logger *__logger;
169
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
9
239
ec81395bf08d Solve name collisions and other problems caused by including Windows headers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 199
diff changeset
10 /* an ERROR macro is defined in `WinGDI.h` which is included
ec81395bf08d Solve name collisions and other problems caused by including Windows headers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 199
diff changeset
11 * by some other header file included before this. to be on
ec81395bf08d Solve name collisions and other problems caused by including Windows headers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 199
diff changeset
12 * the safe side we define the enum lable to the same value */
ec81395bf08d Solve name collisions and other problems caused by including Windows headers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 199
diff changeset
13 #undef ERROR
ec81395bf08d Solve name collisions and other problems caused by including Windows headers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 199
diff changeset
14
169
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
15 enum loglevel {
239
ec81395bf08d Solve name collisions and other problems caused by including Windows headers
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 199
diff changeset
16 ERROR = 0,
252
d948e3ced2b9 Fix previous commit
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 251
diff changeset
17 WARNING,
169
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
18 INFO,
252
d948e3ced2b9 Fix previous commit
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 251
diff changeset
19 DEBUG,
169
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
20 };
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
21
252
d948e3ced2b9 Fix previous commit
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 251
diff changeset
22 struct logger * __logger_init(void(*onerror)(int, const char *));
169
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
23 void __logmessage(struct logger *l, enum loglevel level, const char *frmt, ...);
252
d948e3ced2b9 Fix previous commit
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 251
diff changeset
24 void __logger_panel_visible(struct logger *l, int visible);
169
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
25
252
d948e3ced2b9 Fix previous commit
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 251
diff changeset
26 #define logger_init(onerror) do { __logger = __logger_init(onerror); } while (0)
251
307fd62f376d Implement log file rotation
Daniele Nicolodi <daniele@grinta.net>
parents: 239
diff changeset
27 #define logmessage(level, msg, ...) __logmessage(__logger, (level), (msg), ##__VA_ARGS__)
307fd62f376d Implement log file rotation
Daniele Nicolodi <daniele@grinta.net>
parents: 239
diff changeset
28 #define logmsg(msg, ...) __logmessage(__logger, INFO, msg, ##__VA_ARGS__)
307fd62f376d Implement log file rotation
Daniele Nicolodi <daniele@grinta.net>
parents: 239
diff changeset
29 #define logger_panel_visible(visible) __logger_panel_visible(__logger, visible)
169
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
30
97112b45b838 Get Sr data logger parameters from configuration file. Code reorganization.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
31 #endif