librsync  2.3.0
Macros | Enumerations | Functions | Variables
trace.h File Reference

Go to the source code of this file.

Macros

#define FMT_LONG   "%"PRIdMAX
 
#define FMT_WEAKSUM   "%08"PRIx32
 
#define FMT_SIZE   "%Iu"
 
#define rs_trace_enabled()   0
 
#define rs_trace(...)
 
#define rs_log(l, ...)   rs_log0((l), __func__, __VA_ARGS__)
 
#define rs_error(...)   rs_log0(RS_LOG_ERR, __func__, __VA_ARGS__)
 
#define rs_fatal(...)
 

Enumerations

enum  { RS_LOG_PRIMASK = 7, RS_LOG_NONAME = 8 }
 

Functions

void rs_log0 (int level, char const *fn, char const *fmt,...) __attribute__((format(printf
 

Variables

int rs_trace_level
 

Detailed Description

logging functions.

trace may be turned off.

error is always on, but you can return and continue in some way.

fatal terminates the whole process.

Todo:
A function like perror that includes strerror output. Apache does this by adding flags as well as the severity level which say whether such information should be included.

Definition in file trace.h.

Macro Definition Documentation

◆ rs_trace_enabled

#define rs_trace_enabled ( )    0

Call this before putting too much effort into generating trace messages.

Definition at line 69 of file trace.h.

◆ rs_fatal

#define rs_fatal (   ...)
Value:
do { \
rs_log0(RS_LOG_CRIT, __func__, __VA_ARGS__); \
abort(); \
} while (0)

Definition at line 75 of file trace.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RS_LOG_PRIMASK 

Mask to extract priority part.

RS_LOG_NONAME 

Don't show function name in message.

Definition at line 80 of file trace.h.

RS_LOG_CRIT
@ RS_LOG_CRIT
Critical conditions.
Definition: librsync.h:121