| 847 | } |
| 848 | |
| 849 | static const char *ui_log_level_name(yyjson_val *v) { |
| 850 | static const char *const known[] = {"debug", "log", "info", "warn", "error"}; |
| 851 | const char *s = (v && yyjson_is_str(v)) ? yyjson_get_str(v) : ""; |
| 852 | for (size_t i = 0; i < sizeof(known) / sizeof(known[0]); i++) { |
| 853 | if (strcmp(s, known[i]) == 0) |
| 854 | return known[i]; |
| 855 | } |
| 856 | return "log"; |
| 857 | } |
| 858 | |
| 859 | /* Append `,"key":"<escaped value>"` for a string member, or nothing when the |
| 860 | * member is absent or not a string (required ones are written empty). */ |
no outgoing calls
no test coverage detected