Reduce cpp logging overhead

This commit is contained in:
topjohnwu
2023-05-09 19:14:08 -07:00
parent 7518092ad2
commit 583ffc8177
4 changed files with 5 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ using namespace std;
static int fmt_and_log_with_rs(LogLevel level, const char *fmt, va_list ap) {
char buf[4096];
int ret = vssprintf(buf, sizeof(buf), fmt, ap);
log_with_rs(level, rust::Str(buf, ret));
log_with_rs(level, rust::Slice(reinterpret_cast<const uint8_t *>(buf), ret));
return ret;
}