Bremen Team - Hangar / SML2

Dependencies:   CalibrateMagneto QuaternionMath

Fork of SML2 by TobyRich GmbH

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Logger.h Source File

Logger.h

00001 #ifndef _H_LOGGER_H
00002 #define _H_LOGGER_H
00003 
00004 #define xDEBUG_OUTPUT
00005 
00006 #include <cstdio>
00007 #if defined(DEBUG) && defined(DEBUG_OUTPUT)
00008 #define LOG(x, ...)  { printf("\x1b[34m%12.12s: \x1b[39m"x"\x1b[39;49m\r\n", DEBUG, ##__VA_ARGS__); fflush(stdout); }
00009 #define WARN(x, ...) { printf("\x1b[34m%12.12s: \x1b[33m"x"\x1b[39;49m\r\n", DEBUG, ##__VA_ARGS__); fflush(stdout); }
00010 #define ERR(x, ...)  { printf("\x1b[34m%12.12s: \x1b[31m"x"\x1b[39;49m\r\n", DEBUG, ##__VA_ARGS__); fflush(stdout); }
00011 #define INFO(x, ...) { printf("\x1b[34m%12.12s: \x1b[32m"x"\x1b[39;49m\r\n", DEBUG, ##__VA_ARGS__); fflush(stdout); }
00012 #else
00013 #define LOG(x, ...)
00014 #define WARN(x, ...)
00015 #define ERR(x, ...)
00016 #define INFO(x, ...)
00017 #endif
00018 
00019 #if defined(DATA_OUTPUT)
00020 #define DATA(x) { fwrite(&(x), sizeof (x), 1, stdout); fflush(stdout); }
00021 #else
00022 #define DATA(x)
00023 #endif
00024 
00025 #endif//_H_LOGGER_H