align the debug level in the output
This commit is contained in:
+3
-3
@@ -74,7 +74,7 @@ inline const char *uc_ll_2_str(enum UC_LOG_LEVEL l)
|
|||||||
return "ERROR";
|
return "ERROR";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "???";
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int uc_ll_2_syslog(enum UC_LOG_LEVEL l)
|
static inline int uc_ll_2_syslog(enum UC_LOG_LEVEL l)
|
||||||
@@ -330,11 +330,11 @@ static inline void uc_vlog_file(const struct uc_log_args *args, const char *fmt,
|
|||||||
|
|
||||||
|
|
||||||
if (dest->log_location) {
|
if (dest->log_location) {
|
||||||
fprintf(dest->type.file.file, "[%s] %s %s:%d [%s] : ",
|
fprintf(dest->type.file.file, "[%-7s] %s %s:%d [%s] : ",
|
||||||
uc_ll_2_str(args->log_level), time_buf, args->file,
|
uc_ll_2_str(args->log_level), time_buf, args->file,
|
||||||
args->line, args->module->short_name);
|
args->line, args->module->short_name);
|
||||||
} else {
|
} else {
|
||||||
fprintf(dest->type.file.file, "[%s] %s [%s]: ",
|
fprintf(dest->type.file.file, "[%-7s] %s [%s]: ",
|
||||||
uc_ll_2_str(args->log_level), time_buf, args->module->short_name);
|
uc_ll_2_str(args->log_level), time_buf, args->module->short_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -56,7 +56,7 @@ START_TEST (test_logfile_location)
|
|||||||
|
|
||||||
rc = stat(FILE_NAME, &st);
|
rc = stat(FILE_NAME, &st);
|
||||||
fail_if(rc != 0, "stat failed: %s\n", strerror(errno));
|
fail_if(rc != 0, "stat failed: %s\n", strerror(errno));
|
||||||
fail_if(st.st_size != 74*2, "was %ld\n", (long)st.st_size);
|
fail_if(st.st_size != 76*2, "was %ld\n", (long)st.st_size);
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
START_TEST (test_logfile_no_location)
|
START_TEST (test_logfile_no_location)
|
||||||
@@ -86,7 +86,7 @@ START_TEST (test_logfile_no_location)
|
|||||||
|
|
||||||
rc = stat(FILE_NAME, &st);
|
rc = stat(FILE_NAME, &st);
|
||||||
fail_if(rc != 0, "stat failed: %s\n", strerror(errno));
|
fail_if(rc != 0, "stat failed: %s\n", strerror(errno));
|
||||||
fail_if(st.st_size != 50*2, "was %ld\n", (long)st.st_size);
|
fail_if(st.st_size != 52*2, "was %ld\n", (long)st.st_size);
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
START_TEST (test_logfile_loglevel_surpressed_dest)
|
START_TEST (test_logfile_loglevel_surpressed_dest)
|
||||||
@@ -180,7 +180,7 @@ START_TEST (test_logfile_reopen_files)
|
|||||||
|
|
||||||
rc = stat(FILE_NAME, &st);
|
rc = stat(FILE_NAME, &st);
|
||||||
fail_if(rc != 0, "stat failed: %s\n", strerror(errno));
|
fail_if(rc != 0, "stat failed: %s\n", strerror(errno));
|
||||||
fail_if(st.st_size != 75*2, "was %ld\n", (long)st.st_size);
|
fail_if(st.st_size != 77*2, "was %ld\n", (long)st.st_size);
|
||||||
|
|
||||||
rc = remove(FILE_NAME);
|
rc = remove(FILE_NAME);
|
||||||
fail_if(rc != 0, "Remove failed %s\n", strerror(errno));
|
fail_if(rc != 0, "Remove failed %s\n", strerror(errno));
|
||||||
@@ -192,7 +192,7 @@ START_TEST (test_logfile_reopen_files)
|
|||||||
|
|
||||||
rc = stat(FILE_NAME, &st);
|
rc = stat(FILE_NAME, &st);
|
||||||
fail_if(rc != 0, "2. stat failed: %s\n", strerror(errno));
|
fail_if(rc != 0, "2. stat failed: %s\n", strerror(errno));
|
||||||
fail_if(st.st_size != 75, "was %ld\n", (long)st.st_size);//should only one line there now
|
fail_if(st.st_size != 77, "was %ld\n", (long)st.st_size);//should only one line there now
|
||||||
|
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ START_TEST (test_logfile_remove_dest)
|
|||||||
|
|
||||||
rc = stat(FILE_NAME, &st);
|
rc = stat(FILE_NAME, &st);
|
||||||
fail_if(rc != 0, "stat failed: %s\n", strerror(errno));
|
fail_if(rc != 0, "stat failed: %s\n", strerror(errno));
|
||||||
fail_if(st.st_size != 75*2, "was %ld\n", (long)st.st_size);
|
fail_if(st.st_size != 77*2, "was %ld\n", (long)st.st_size);
|
||||||
|
|
||||||
uc_log_remove_destination(dest1);
|
uc_log_remove_destination(dest1);
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ START_TEST (test_logfile_remove_dest)
|
|||||||
|
|
||||||
rc = stat(FILE_NAME, &st);
|
rc = stat(FILE_NAME, &st);
|
||||||
fail_if(rc != 0, "2. stat failed: %s\n", strerror(errno));
|
fail_if(rc != 0, "2. stat failed: %s\n", strerror(errno));
|
||||||
fail_if(st.st_size != 75*2, "was %ld\n", (long)st.st_size);//should be same size
|
fail_if(st.st_size != 77*2, "was %ld\n", (long)st.st_size);//should be same size
|
||||||
|
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user