+ const char *rst_color_p = bt_common_color_reset();
+ const char *rst_color_e = rst_color_p + strlen(rst_color_p);
+ const char *color_p = "";
+ const char *color_e = color_p;
+
+ switch (lvl) {
+ case BT_LOG_INFO:
+ color_p = bt_common_color_fg_blue();
+ color_e = color_p + strlen(color_p);
+ break;
+ case BT_LOG_WARN:
+ color_p = bt_common_color_fg_yellow();
+ color_e = color_p + strlen(color_p);
+ break;
+ case BT_LOG_ERROR:
+ case BT_LOG_FATAL:
+ color_p = bt_common_color_fg_red();
+ color_e = color_p + strlen(color_p);
+ break;
+ default:
+ break;
+ }
+
+ msg.p = put_stringn(color_p, color_e, msg.p, msg.e);
+