Add configs for toml in controller

This commit is contained in:
Tobias Reisinger 2020-11-22 01:49:20 +01:00
parent 750002daf2
commit 87b3f06092
6 changed files with 79 additions and 74 deletions

View file

@ -65,7 +65,13 @@ logger_log(int level, const char *filename, int line, const char *func, const ch
strftime(timestamp_str, 32, "%Y-%m-%d %H:%M:%S", localtime(&rawtime));
size_t timestamp_len = strlen(timestamp_str);
char *buffer = malloc(sizeof(char) * (128 + strlen(msg) + timestamp_len));
size_t buffer_size = 128;
buffer_size += timestamp_len;
buffer_size += strlen(filename);
buffer_size += strlen(func);
buffer_size += strlen(msg);
char *buffer = malloc(sizeof(char) * (buffer_size));
sprintf(buffer, "%s %s[%5s] %s:%d:%s " COLOR_NONE "%s", timestamp_str, color, level_str, filename, line, func, msg);
// start arg va_list and find log_len