... | ... |
@@ -5,6 +5,7 @@ |
5 | 5 |
* |
6 | 6 |
* History: |
7 | 7 |
* 27/01/2014 Creation |
8 |
+ * 14/03/2014 Add log_setlogfile(), log_closelogfile. |
|
8 | 9 |
* |
9 | 10 |
* Author: Dario Rodriguez dario@softhome.net |
10 | 11 |
* This file is licensed under the terms of the GNU LGPL v2+ |
... | ... |
@@ -20,6 +21,9 @@ void log_write(char *type, char *format, ...) __attribute__ ((format (printf, 2, |
20 | 21 |
#endif |
21 | 22 |
|
22 | 23 |
char *log_hexdumpstr(char *data, long datasize); |
24 |
+ |
|
25 |
+void log_setlogfile(char *filename); |
|
26 |
+void log_closelogfile(void); |
|
23 | 27 |
void log_setwritefunc(void (*newwritefunc)(int fd, char *buf, long bufsize, void *usrptr),void *usrptr); |
24 | 28 |
|
25 | 29 |
#endif |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,25 @@ |
1 |
+/* |
|
2 |
+ * loglib.h |
|
3 |
+ * |
|
4 |
+ * A non-intrusive minimal log framework. |
|
5 |
+ * |
|
6 |
+ * History: |
|
7 |
+ * 27/01/2014 Creation |
|
8 |
+ * |
|
9 |
+ * Author: Dario Rodriguez dario@softhome.net |
|
10 |
+ * This file is licensed under the terms of the GNU LGPL v2+ |
|
11 |
+ */ |
|
12 |
+ |
|
13 |
+#ifndef LOGLIB_H |
|
14 |
+#define LOGLIB_H |
|
15 |
+ |
|
16 |
+#ifndef __GNUC__ |
|
17 |
+void log_write(char *type, char *format, ...); |
|
18 |
+#else |
|
19 |
+void log_write(char *type, char *format, ...) __attribute__ ((format (printf, 2, 3))); |
|
20 |
+#endif |
|
21 |
+ |
|
22 |
+char *log_hexdumpstr(char *data, long datasize); |
|
23 |
+void log_setwritefunc(void (*newwritefunc)(int fd, char *buf, long bufsize, void *usrptr),void *usrptr); |
|
24 |
+ |
|
25 |
+#endif |