mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
remove flash
This commit is contained in:
@@ -26,17 +26,17 @@ namespace uuid {
|
||||
|
||||
namespace log {
|
||||
|
||||
static constexpr const char * pstr_level_lowercase_off __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "off";
|
||||
static constexpr const char * pstr_level_lowercase_emerg __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "emerg";
|
||||
static constexpr const char * pstr_level_lowercase_crit __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "crit";
|
||||
static constexpr const char * pstr_level_lowercase_alert __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "alert";
|
||||
static constexpr const char * pstr_level_lowercase_err __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "err";
|
||||
static constexpr const char * pstr_level_lowercase_warning __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "warning";
|
||||
static constexpr const char * pstr_level_lowercase_notice __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "notice";
|
||||
static constexpr const char * pstr_level_lowercase_info __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "info";
|
||||
static constexpr const char * pstr_level_lowercase_debug __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "debug";
|
||||
static constexpr const char * pstr_level_lowercase_trace __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "trace";
|
||||
static constexpr const char * pstr_level_lowercase_all __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "all";
|
||||
static constexpr const char * pstr_level_lowercase_off = "off";
|
||||
static constexpr const char * pstr_level_lowercase_emerg = "emerg";
|
||||
static constexpr const char * pstr_level_lowercase_crit = "crit";
|
||||
static constexpr const char * pstr_level_lowercase_alert = "alert";
|
||||
static constexpr const char * pstr_level_lowercase_err = "err";
|
||||
static constexpr const char * pstr_level_lowercase_warning = "warning";
|
||||
static constexpr const char * pstr_level_lowercase_notice = "notice";
|
||||
static constexpr const char * pstr_level_lowercase_info = "info";
|
||||
static constexpr const char * pstr_level_lowercase_debug = "debug";
|
||||
static constexpr const char * pstr_level_lowercase_trace = "trace";
|
||||
static constexpr const char * pstr_level_lowercase_all = "all";
|
||||
|
||||
static const __FlashStringHelper * log_level_lowercase[(int)Level::ALL - (int)Level::OFF + 1] __attribute__((__aligned__(sizeof(uint32_t))))
|
||||
PROGMEM = {reinterpret_cast<const __FlashStringHelper *>(pstr_level_lowercase_off),
|
||||
|
||||
@@ -26,17 +26,17 @@ namespace uuid {
|
||||
|
||||
namespace log {
|
||||
|
||||
static constexpr const char * pstr_level_uppercase_off __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "OFF";
|
||||
static constexpr const char * pstr_level_uppercase_emerg __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "EMERG";
|
||||
static constexpr const char * pstr_level_uppercase_crit __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "CRIT";
|
||||
static constexpr const char * pstr_level_uppercase_alert __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "ALERT";
|
||||
static constexpr const char * pstr_level_uppercase_err __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "ERR";
|
||||
static constexpr const char * pstr_level_uppercase_warning __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "WARNING";
|
||||
static constexpr const char * pstr_level_uppercase_notice __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "NOTICE";
|
||||
static constexpr const char * pstr_level_uppercase_info __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "INFO";
|
||||
static constexpr const char * pstr_level_uppercase_debug __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "DEBUG";
|
||||
static constexpr const char * pstr_level_uppercase_trace __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "TRACE";
|
||||
static constexpr const char * pstr_level_uppercase_all __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "ALL";
|
||||
static constexpr const char * pstr_level_uppercase_off = "OFF";
|
||||
static constexpr const char * pstr_level_uppercase_emerg = "EMERG";
|
||||
static constexpr const char * pstr_level_uppercase_crit = "CRIT";
|
||||
static constexpr const char * pstr_level_uppercase_alert = "ALERT";
|
||||
static constexpr const char * pstr_level_uppercase_err = "ERR";
|
||||
static constexpr const char * pstr_level_uppercase_warning = "WARNING";
|
||||
static constexpr const char * pstr_level_uppercase_notice = "NOTICE";
|
||||
static constexpr const char * pstr_level_uppercase_info = "INFO";
|
||||
static constexpr const char * pstr_level_uppercase_debug = "DEBUG";
|
||||
static constexpr const char * pstr_level_uppercase_trace = "TRACE";
|
||||
static constexpr const char * pstr_level_uppercase_all = "ALL";
|
||||
|
||||
static const __FlashStringHelper * log_level_uppercase[(int)Level::ALL - (int)Level::OFF + 1] __attribute__((__aligned__(sizeof(uint32_t))))
|
||||
PROGMEM = {reinterpret_cast<const __FlashStringHelper *>(pstr_level_uppercase_off),
|
||||
|
||||
@@ -47,7 +47,7 @@ std::string format_timestamp_ms(uint64_t timestamp_ms, unsigned int days_width)
|
||||
|
||||
static std::vector<char> text(10 + 1 /* days */ + 2 + 1 /* hours */ + 2 + 1 /* minutes */ + 2 + 1 /* seconds */ + 3 /* milliseconds */ + 1);
|
||||
|
||||
snprintf_P(text.data(), text.size(), PSTR("%0*lu+%02u:%02u:%02u.%03u"), std::min(days_width, 10U), days, hours, minutes, seconds, milliseconds);
|
||||
snprintf(text.data(), text.size(), ("%0*lu+%02u:%02u:%02u.%03u"), std::min(days_width, 10U), days, hours, minutes, seconds, milliseconds);
|
||||
|
||||
return text.data();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace log {
|
||||
std::map<Handler *, Level> Logger::handlers_;
|
||||
Level Logger::level_ = Level::OFF;
|
||||
|
||||
Message::Message(uint64_t uptime_ms, Level level, Facility facility, const __FlashStringHelper * name, const std::string && text)
|
||||
Message::Message(uint64_t uptime_ms, Level level, Facility facility, const char * name, const std::string && text)
|
||||
: uptime_ms(uptime_ms)
|
||||
, level(level)
|
||||
, facility(facility)
|
||||
@@ -44,7 +44,7 @@ Message::Message(uint64_t uptime_ms, Level level, Facility facility, const __Fla
|
||||
, text(std::move(text)) {
|
||||
}
|
||||
|
||||
Logger::Logger(const __FlashStringHelper * name, Facility facility)
|
||||
Logger::Logger(const char * name, Facility facility)
|
||||
: name_(name)
|
||||
, facility_(facility){
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ struct Message {
|
||||
* @param[in] text Log message text.
|
||||
* @since 1.0.0
|
||||
*/
|
||||
Message(uint64_t uptime_ms, Level level, Facility facility, const __FlashStringHelper * name, const std::string && text);
|
||||
Message(uint64_t uptime_ms, Level level, Facility facility, const char * name, const std::string && text);
|
||||
~Message() = default;
|
||||
|
||||
/**
|
||||
@@ -261,7 +261,7 @@ struct Message {
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
const __FlashStringHelper * name;
|
||||
const char * name;
|
||||
|
||||
/**
|
||||
* Formatted log message text.
|
||||
@@ -331,7 +331,7 @@ class Logger {
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
Logger(const __FlashStringHelper * name, Facility facility = Facility::LOCAL0);
|
||||
Logger(const char * name, Facility facility = Facility::LOCAL0);
|
||||
~Logger() = default;
|
||||
|
||||
/**
|
||||
@@ -626,7 +626,7 @@ class Logger {
|
||||
static std::map<Handler *, Level> handlers_; /*!< Registered log handlers. @since 1.0.0 */
|
||||
static Level level_; /*!< Minimum global log level across all handlers. @since 1.0.0 */
|
||||
|
||||
const __FlashStringHelper * name_; /*!< Logger name (flash string). @since 1.0.0 */
|
||||
const char * name_; /*!< Logger name (flash string). @since 1.0.0 */
|
||||
const Facility facility_; /*!< Default logging facility for messages. @since 1.0.0 */
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user