mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
-40b
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
#include "Errors.h"
|
||||
#include "Global.h"
|
||||
|
||||
|
||||
#define pm PrintMessage(MODULE)
|
||||
|
||||
class PrintMessage {
|
||||
@@ -24,8 +23,23 @@ class PrintMessage {
|
||||
}
|
||||
|
||||
private:
|
||||
void printErrorLevel(ErrorLevel_t level) {
|
||||
Serial.printf("[%c] ", getErrorLevelStr(level));
|
||||
}
|
||||
|
||||
void printUptime() {
|
||||
Serial.printf("%lu ", ((unsigned long)millis() / 1000));
|
||||
}
|
||||
|
||||
void printModule() {
|
||||
Serial.printf("[%s] ", _module);
|
||||
}
|
||||
|
||||
void print(const ErrorLevel_t level, const String& str) {
|
||||
Serial.printf("%s [%s] [%s] %s\n", prettyMillis(millis()).c_str(), getErrorLevelStr(level).c_str(), _module, str.c_str());
|
||||
printUptime();
|
||||
printErrorLevel(level);
|
||||
printModule();
|
||||
Serial.println(str.c_str());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -26,4 +26,6 @@ size_t itemsCount(String str, const String& separator);
|
||||
|
||||
boolean isDigitStr(const String&);
|
||||
|
||||
String prettyBytes(size_t size);
|
||||
String prettyBytes(size_t size);
|
||||
|
||||
const char getErrorLevelStr(uint8_t level);
|
||||
Reference in New Issue
Block a user