LOGGING: Add syslog log target
[osmocom-bb.git] / include / osmocore / logging.h
index 70e8f14..d4d632d 100644 (file)
@@ -19,7 +19,6 @@
 #define DEBUGPC(ss, fmt, args...)
 #endif
 
-#define static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1];
 
 void logp(unsigned int subsys, char *file, int line, int cont, const char *format, ...) __attribute__ ((format (printf, 5, 6)));
 
@@ -84,6 +83,7 @@ struct log_target {
        union {
                struct {
                        FILE *out;
+                       const char *fname;
                } tgt_file;
 
                struct {
@@ -95,7 +95,8 @@ struct log_target {
                } tgt_vty;
        };
 
-        void (*output) (struct log_target *target, const char *string);
+        void (*output) (struct log_target *target, unsigned int level,
+                       const char *string);
 };
 
 /* use the above macros */
@@ -123,7 +124,13 @@ void log_set_category_filter(struct log_target *target, int category,
 
 /* management of the targets */
 struct log_target *log_target_create(void);
+void log_target_destroy(struct log_target *target);
 struct log_target *log_target_create_stderr(void);
+struct log_target *log_target_create_file(const char *fname);
+struct log_target *log_target_create_syslog(const char *ident, int option,
+                                           int facility);
+int log_target_file_reopen(struct log_target *tgt);
+
 void log_add_target(struct log_target *target);
 void log_del_target(struct log_target *target);