mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-23 20:11:49 +00:00
Limit len of prefix; makes log tidy w/ long names
PUBLISHED_FROM=570530179da327f8bb156bbbd7c557014c1630c1
This commit is contained in:
1 parent
7988acbff4
commit
2ea63a0ea6
1 file changed
+4
-1
+4
-1
@@ -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) WEAK;
|
||||||
void cs_log_print_prefix(const char *func) {
|
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;
|
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
|
#if CS_LOG_ENABLE_TS_DIFF
|
||||||
{
|
{
|
||||||
double now = cs_time();
|
double now = cs_time();
|
||||||
|
|||||||
Reference in new issue
Block a user