project_files/frontlib/util/logging.h
author Medo <smaxein@googlemail.com>
Mon, 25 Jun 2012 00:42:07 +0200
changeset 7271 5608ac657362
parent 7224 5143861c83bd
child 7275 15f722e0b96f
permissions -rw-r--r--
frontlib: Intermittent commit. Things are still in flux but we're getting there :)

#ifndef LOGGING_H_
#define LOGGING_H_

#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>

#define FLIB_LOGLEVEL_ALL -100
#define FLIB_LOGLEVEL_DEBUG -1
#define FLIB_LOGLEVEL_INFO 0
#define FLIB_LOGLEVEL_WARNING 1
#define FLIB_LOGLEVEL_ERROR 2
#define FLIB_LOGLEVEL_NONE 100

/**
 * Returns a pointer to a static buffer, don't free or store.
 */
char* flib_format_ip(uint32_t numip);

void flib_log_e(const char *fmt, ...);
void flib_log_w(const char *fmt, ...);
void flib_log_i(const char *fmt, ...);
void flib_log_d(const char *fmt, ...);

int flib_log_getLevel();
void flib_log_setLevel(int level);
void flib_log_setFile(FILE *logfile);
bool flib_log_isActive(int level);

#endif /* LOGGING_H_ */