2021-01-06 19:49:58 +01:00
|
|
|
#if FSFW_DISABLE_PRINTOUT == 0
|
2021-01-08 16:23:57 +01:00
|
|
|
#include <cstdio>
|
2021-01-06 19:49:58 +01:00
|
|
|
#endif
|
2021-01-03 01:02:07 +01:00
|
|
|
|
|
|
|
namespace fsfw {
|
|
|
|
|
2021-01-08 16:14:11 +01:00
|
|
|
enum PrintLevel {
|
2021-01-03 01:02:07 +01:00
|
|
|
NONE = 0,
|
|
|
|
//! Strange error when using just ERROR..
|
|
|
|
ERROR_TYPE = 1,
|
|
|
|
WARNING = 2,
|
|
|
|
INFO = 3,
|
|
|
|
DEBUG = 4
|
|
|
|
};
|
|
|
|
|
2021-01-08 16:14:11 +01:00
|
|
|
/**
|
|
|
|
* Set the print level. All print types with a smaller level will be printed
|
|
|
|
* as well. For example, set to PrintLevel::WARNING to only enable error
|
|
|
|
* and warning output.
|
|
|
|
* @param printLevel
|
|
|
|
*/
|
2021-01-03 01:02:07 +01:00
|
|
|
void setPrintLevel(PrintLevel printLevel);
|
|
|
|
PrintLevel getPrintLevel();
|
|
|
|
|
2021-01-08 02:06:27 +01:00
|
|
|
void setToAddCrAtEnd(bool addCrAtEnd_);
|
|
|
|
|
2021-01-03 01:47:01 +01:00
|
|
|
/**
|
|
|
|
* These functions can be used like the C stdio printf and forward the
|
|
|
|
* supplied formatted string arguments to a printf function.
|
|
|
|
* They prepend the string with a color (if enabled), a log preamble and
|
|
|
|
* a timestamp.
|
|
|
|
* @param fmt Formatted string
|
|
|
|
*/
|
2021-01-03 01:02:07 +01:00
|
|
|
void printInfo(const char *fmt, ...);
|
|
|
|
void printWarning(const char* fmt, ...);
|
|
|
|
void printDebug(const char* fmt, ...);
|
|
|
|
void printError(const char* fmt, ...);
|
|
|
|
|
|
|
|
}
|
|
|
|
|