重构:改进各种模块中的日志记录和错误处理

This commit is contained in:
2025-05-13 16:58:24 +08:00
parent 8d01ad91c4
commit cbc52fb72d
12 changed files with 110 additions and 61 deletions

View File

@@ -10,6 +10,7 @@
#include "widget/panel_widget/mbox.h"
#include "utf8.h"
#include "misc/log_util.h"
#include "widget/leaf_widget/meditable_text_box.h"
#include "widget/panel_widget/moverlay.h"
@@ -35,11 +36,11 @@ void test_color() {
for (const char* test_str: test_cases) {
std::optional<linear_color> color = linear_color::from_string(test_str);
std::println(std::cout, "Parsing '{}': ", test_str);
log_info("Parsing '{}': ", test_str);
if (color) {
std::println(std::cout, "Success -> r:{}, g:{}, b:{}, a:{}", color->r, color->g, color->b, color->a);
log_info("Success -> r:{}, g:{}, b:{}, a:{}", color->r, color->g, color->b, color->a);
}
else { std::println(std::cerr, "Failed to parse color string: {}", test_str); }
else { log_info("Failed to parse color string: {}", test_str); }
}
}