1 # Debugging trace and error logging {#api_trace}
3 librsync can output trace or log messages as it proceeds.
5 messages supplement
return codes by describing in more detail what went
6 wrong. Debug messages are useful when debugging librsync or applications
10 follow a fairly standard priority-based filtering system
12 Messages by
default are sent to stderr, but may be passed to an
15 The
default configuration is that warning and error messages are written
16 to stderr. This should be appropriate
for many applications. If it is
17 not, the level and destination of messages may be changed.
19 Messages are passed out of librsync through a trace callback which is
20 passed a severity and message
string. The type
for this callback is
25 The trace callback may be changed at runtime with \ref
rs_trace_to.
27 Messages from librsync are labelled with a severity indicator of
30 The application may also specify a minimum severity of interest through
32 Messages lower than the specified level
33 are discarded without being passed to the trace callback.
LIBRSYNC_EXPORT void rs_trace_stderr(rs_loglevel level, char const *msg)
Default trace callback that writes to stderr.
LIBRSYNC_EXPORT void rs_trace_to(rs_trace_fn_t *)
Set trace callback.
LIBRSYNC_EXPORT void rs_trace_set_level(rs_loglevel level)
Set the least important message severity that will be output.
void rs_trace_fn_t(rs_loglevel level, char const *msg)
Callback to write out log messages.
rs_loglevel
Log severity levels.