Commit 2ea63a0e authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Limit len of prefix; makes log tidy w/ long names

PUBLISHED_FROM=570530179da327f8bb156bbbd7c557014c1630c1
parent 7988acbf
......@@ -294,8 +294,11 @@ double cs_log_ts WEAK;
void cs_log_print_prefix(const char *func) WEAK;
void cs_log_print_prefix(const char *func) {
char prefix[21];
strncpy(prefix, func, 20);
prefix[20] = '\0';
if (cs_log_file == NULL) cs_log_file = stderr;
fprintf(cs_log_file, "%-20s ", func);
fprintf(cs_log_file, "%-20s ", prefix);
#if CS_LOG_ENABLE_TS_DIFF
{
double now = cs_time();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment