mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
log.c: align/adjust layout
New: 2016/09/27 18:00:49 INFO 28117/tui_flush:597: ... Old: 2016/09/27 18:00:49 [info @ tui_flush:597] 28117 - ...
This commit is contained in:
@@ -146,10 +146,10 @@ static bool v_do_log_to_file(FILE *log_file, int log_level,
|
|||||||
const char* fmt, va_list args)
|
const char* fmt, va_list args)
|
||||||
{
|
{
|
||||||
static const char *log_levels[] = {
|
static const char *log_levels[] = {
|
||||||
[DEBUG_LOG_LEVEL] = "debug",
|
[DEBUG_LOG_LEVEL] = "DEBUG",
|
||||||
[INFO_LOG_LEVEL] = "info",
|
[INFO_LOG_LEVEL] = "INFO ",
|
||||||
[WARNING_LOG_LEVEL] = "warning",
|
[WARNING_LOG_LEVEL] = "WARN ",
|
||||||
[ERROR_LOG_LEVEL] = "error"
|
[ERROR_LOG_LEVEL] = "ERROR"
|
||||||
};
|
};
|
||||||
assert(log_level >= DEBUG_LOG_LEVEL && log_level <= ERROR_LOG_LEVEL);
|
assert(log_level >= DEBUG_LOG_LEVEL && log_level <= ERROR_LOG_LEVEL);
|
||||||
|
|
||||||
@@ -166,8 +166,8 @@ static bool v_do_log_to_file(FILE *log_file, int log_level,
|
|||||||
|
|
||||||
// print the log message prefixed by the current timestamp and pid
|
// print the log message prefixed by the current timestamp and pid
|
||||||
int64_t pid = os_get_pid();
|
int64_t pid = os_get_pid();
|
||||||
if (fprintf(log_file, "%s [%s @ %s:%d] %" PRId64 " - ", date_time,
|
if (fprintf(log_file, "%s %s %" PRId64 "/%s:%d: ", date_time,
|
||||||
log_levels[log_level], func_name, line_num, pid) < 0) {
|
log_levels[log_level], pid, func_name, line_num) < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (vfprintf(log_file, fmt, args) < 0) {
|
if (vfprintf(log_file, fmt, args) < 0) {
|
||||||
|
Reference in New Issue
Block a user