project_files/frontlib/util/logging.h
author Medo <smaxein@googlemail.com>
Tue, 12 Jun 2012 11:25:05 +0200
changeset 7224 5143861c83bd
parent 7182 076aba32abd3
child 7275 15f722e0b96f
permissions -rw-r--r--
Cleanup, refactoring and generally more development in the frontlib

#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_ */