Macros | Functions | Variables
log.c File Reference
#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)
 

Variables

bool bool ret = false
 
FILE * log_file = open_log_file()
 
va_list args
 
end __pad0__
 

Macro Definition Documentation

◆ LOG_FILE_ENV

#define LOG_FILE_ENV   "NVIM_LOG_FILE"

Function Documentation

◆ if() [1/2]

if ( log_file = stderr && log_file != stdout)

◆ if() [2/2]

if ( log_file  = NULL)

◆ log_init()

void log_init ( void  )

◆ log_lock()

void log_lock ( void  )

◆ log_unlock()

void log_unlock ( void  )

◆ log_uv_handles()

void log_uv_handles ( void loop)

◆ logmsg()

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.

Parameters
log_levelLog level (see log.h)
contextDescription of a shared context or subsystem
func_nameFunction name, or NULL
line_numSource line number, or -1
eolAppend linefeed "\n"
fmtprintf-style format string

◆ open_log_file()

FILE* open_log_file ( void  )

Open the log file for appending.

Returns
FILE* decided by log_path_init() or stderr in case of error

◆ va_end()

va_end ( args  )

◆ va_start()

static bool va_start ( args  ,
fmt   
)
Initial value:
{
va_list args

Variable Documentation

◆ __pad0__

end __pad0__

◆ args

va_list args

◆ log_file

FILE* log_file = open_log_file()

◆ ret

return ret = false
args
va_list args
Definition: log.c:149