We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello
This library is awesome. But it doesnt write funciton for output. can you add function name ?
Thanks.
The text was updated successfully, but these errors were encountered:
static int my_format_func(char *buff, int maxlen, struct tlog_loginfo *info, void *userptr, const char *format, va_list ap) { int len = 0; int total_len = 0; struct tlog_time *tm = &info->time; void* unused __attribute__ ((unused)); unused = userptr; /* format prefix */ len = snprintf(buff, maxlen, "[%.4d-%.2d-%.2d %.2d:%.2d:%.2d,%.3d][%5s][%17s:%-4d][%s] ", tm->year, tm->mon, tm->mday, tm->hour, tm->min, tm->sec, tm->usec / 1000, tlog_get_level_string(info->level), info->file, info->line, info->func); if (len < 0 || len >= maxlen) { return -1; } buff += len; total_len += len; maxlen -= len; /* format log message */ len = vsnprintf(buff, maxlen, format, ap); if (len < 0 || len == maxlen) { return -1; } buff += len; total_len += len; /* return total length */ return total_len; } tlog_reg_format_func(my_format_func);
Sorry, something went wrong.
No branches or pull requests
Hello
This library is awesome. But it doesnt write funciton for output. can you add function name ?
Thanks.
The text was updated successfully, but these errors were encountered: