view logging.h @ 185:bc980095a24d

Add scrambler option to KK data provider. Report KK counter version.
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Mon, 24 Feb 2014 13:16:52 +0100
parents 97112b45b838
children 111610d871af
line wrap: on
line source

#ifndef __LOGGING_H__
#define __LOGGING_H__

/* required for the user interface defines */
#include "FXAnalyse.h"
#include "utils.h"

struct logger {
	unsigned int panel;
	int fd;
} __logger;

enum loglevel {
	DEBUG,
	INFO,
	WARNING,
	ERROR,
};

int __logger_init(struct logger *l);
void __logmessage(struct logger *l, enum loglevel level, const char *frmt, ...);

#define logger_init() __logger_init(&__logger)
#define logmessage(level, msg, ...) __logmessage(&__logger, (level), (msg), ##__VA_ARGS__)
#define logmsg(msg, ...) __logmessage(&__logger, INFO, msg, ##__VA_ARGS__)
#define logger_panel_visible(visible)  SetPanelAttribute(__logger.panel, ATTR_VISIBLE, visible)

#endif