Colorize Lua debugger status replies according to the prefix they * have. */
| 925 | /* Colorize Lua debugger status replies according to the prefix they |
| 926 | * have. */ |
| 927 | sds sdsCatColorizedLdbReply(sds o, char *s, size_t len) { |
| 928 | char *color = "white"; |
| 929 | |
| 930 | if (strstr(s,"<debug>")) color = "bold"; |
| 931 | if (strstr(s,"<redis>")) color = "green"; |
| 932 | if (strstr(s,"<reply>")) color = "cyan"; |
| 933 | if (strstr(s,"<error>")) color = "red"; |
| 934 | if (strstr(s,"<hint>")) color = "bold"; |
| 935 | if (strstr(s,"<value>") || strstr(s,"<retval>")) color = "magenta"; |
| 936 | if (len > 4 && isdigit(s[3])) { |
| 937 | if (s[1] == '>') color = "yellow"; /* Current line. */ |
| 938 | else if (s[2] == '#') color = "bold"; /* Break point. */ |
| 939 | } |
| 940 | return sdscatcolor(o,s,len,color); |
| 941 | } |
| 942 | |
| 943 | static sds cliFormatReplyRaw(redisReply *r) { |
| 944 | sds out = sdsempty(), tmp; |
no test coverage detected