#define DEBUGPC(ss, fmt, args...)
#endif
-#define static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1];
-char *hexdump(const unsigned char *buf, int len);
void logp(unsigned int subsys, char *file, int line, int cont, const char *format, ...) __attribute__ ((format (printf, 5, 6)));
/* new logging interface */
union {
struct {
FILE *out;
- } tgt_stdout;
+ const char *fname;
+ } tgt_file;
struct {
int priority;
} 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 */
void log_set_log_level(struct log_target *target, int log_level);
void log_parse_category_mask(struct log_target *target, const char* mask);
int log_parse_level(const char *lvl);
+const char *log_level_str(unsigned int lvl);
int log_parse_category(const char *category);
void log_set_category_filter(struct log_target *target, int category,
int enable, int level);
/* 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);
+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);
+/* Gernerate command argument strings for VTY use */
+const char *log_vty_category_string(struct log_info *info);
+const char *log_vty_level_string(struct log_info *info);
+
#endif /* _OSMOCORE_LOGGING_H */