1
0
forked from fsfw/fsfw

improved DHB error handling

This commit is contained in:
2021-01-08 16:14:11 +01:00
parent 541478e4d5
commit c0fd981360
7 changed files with 152 additions and 87 deletions

View File

@ -2,6 +2,7 @@
#define FSFW_SERVICEINTERFACE_SERVICEINTERFACE_H_
#include <FSFWConfig.h>
#include "serviceInterfaceDefintions.h"
#if FSFW_CPP_OSTREAM_ENABLED == 1
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>

View File

@ -4,7 +4,7 @@
namespace fsfw {
enum class PrintLevel {
enum PrintLevel {
NONE = 0,
//! Strange error when using just ERROR..
ERROR_TYPE = 1,
@ -13,6 +13,12 @@ enum class PrintLevel {
DEBUG = 4
};
/**
* 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
*/
void setPrintLevel(PrintLevel printLevel);
PrintLevel getPrintLevel();

View File

@ -3,6 +3,13 @@
namespace fsfw {
enum class OutputTypes {
OUT_INFO,
OUT_DEBUG,
OUT_WARNING,
OUT_ERROR
};
static const char* const ANSI_COLOR_RED = "\x1b[31m";
static const char* const ANSI_COLOR_GREEN = "\x1b[32m";
static const char* const ANSI_COLOR_YELLOW = "\x1b[33m";