#include <assert.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <uv.h>
#include "auto/config.h"
#include "nvim/log.h"
#include "nvim/os/os.h"
#include "nvim/os/time.h"
#include "nvim/types.h"
Macros | |
#define | LOG_FILE_ENV "NVIM_LOG_FILE" |
Functions | |
void | log_init (void) |
void | log_lock (void) |
void | log_unlock (void) |
bool | logmsg (int log_level, const char *context, const char *func_name, int line_num, bool eol, const char *fmt,...) FUNC_ATTR_UNUSED FUNC_ATTR_PRINTF(6 |
if (log_file==NULL) | |
va_start (args, fmt) | |
va_end (args) | |
if (log_file !=stderr &&log_file !=stdout) | |
void | log_uv_handles (void *loop) |
FILE * | open_log_file (void) |
static bool | assert (log_level >=DEBUG_LOG_LEVEL &&log_level<=ERROR_LOG_LEVEL) |
if (os_localtime(&local_time)==NULL) | |
if (strftime(date_time, sizeof(date_time), "%Y-%m-%dT%H:%M:%S", &local_time)==0) | |
if (uv_gettimeofday(&curtime)==0) | |
if (rv< 0) | |
if (eol) | |
if (fflush(log_file)==EOF) | |
Variables | |
bool bool | ret = false |
FILE * | log_file = open_log_file() |
va_list | args |
end | __pad0__ |
struct tm | local_time |
char | date_time [20] |
int | millis = 0 |
uv_timeval64_t | curtime |
int64_t | pid = os_get_pid() |
int | rv |
return | true |
#define LOG_FILE_ENV "NVIM_LOG_FILE" |
static bool assert | ( | log_level >=DEBUG_LOG_LEVEL &&log_level<= | ERROR_LOG_LEVEL | ) |
if | ( | eol | ) |
if | ( | fflush(log_file) | = = EOF | ) |
if | ( | os_localtime & | local_time = = NULL | ) |
if | ( | ) |
if | ( | uv_gettimeofday & | curtime = = 0 | ) |
bool logmsg | ( | int | log_level, |
const char * | context, | ||
const char * | func_name, | ||
int | line_num, | ||
bool | eol, | ||
const char * | fmt, | ||
... | |||
) |
Logs a message to $NVIM_LOG_FILE.
log_level | Log level (see log.h) |
context | Description of a shared context or subsystem |
func_name | Function name, or NULL |
line_num | Source line number, or -1 |
eol | Append linefeed "\n" |
fmt | printf-style format string |
FILE* open_log_file | ( | void | ) |
Open the log file for appending.
va_end | ( | args | ) |
end __pad0__ |
va_list args |
uv_timeval64_t curtime |
char date_time[20] |
struct tm local_time |
FILE* log_file = open_log_file() |
int millis = 0 |
int64_t pid = os_get_pid() |
int rv |
return true |