blob: 8e7a7a0682ec98e62311cdeb990b5502040c7eb1 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#include <stdio.h>
2#include <stdarg.h>
3#include "mgui_utils.h"
4
5int __mgui_log_print(const char *fmt, ...)
6{
7 va_list ap;
8 char buf[LOG_BUF_SIZE];
9 int write_length = 0;
10
11 va_start(ap, fmt);
12 write_length = vsnprintf(&buf[write_length], LOG_BUF_SIZE, fmt, ap);
13 va_end(ap);
14 buf[write_length++] = '\n';
15 buf[write_length++] = '\0';
16 printf("%s", buf);
17
18 return write_length;
19}