\label{api_trace_md_doc_trace}%
\Hypertarget{api_trace_md_doc_trace}%
 librsync can output trace or log messages as it proceeds. Error messages supplement return codes by describing in more detail what went wrong. Debug messages are useful when debugging librsync or applications that call it.

These follow a fairly standard priority-\/based filtering system (\mbox{\hyperlink{librsync_8h_ae4427ad71847687ea6465d41f8209532}{rs\+\_\+trace\+\_\+set\+\_\+level()}}), using the same severity levels as UNIX syslog. Messages by default are sent to stderr, but may be passed to an application-\/provided callback (\mbox{\hyperlink{librsync_8h_a03b75bac7cfb13233f0a030d723d112a}{rs\+\_\+trace\+\_\+to()}}, \mbox{\hyperlink{librsync_8h_a764a02859f292e5df72b9f948a335712}{rs\+\_\+trace\+\_\+fn\+\_\+t()}}).

The default configuration is that warning and error messages are written to stderr. This should be appropriate for many applications. If it is not, the level and destination of messages may be changed.

Messages are passed out of librsync through a trace callback which is passed a severity and message string. The type for this callback is \mbox{\hyperlink{librsync_8h_a764a02859f292e5df72b9f948a335712}{rs\+\_\+trace\+\_\+fn\+\_\+t}}.

The default trace function is \mbox{\hyperlink{librsync_8h_a58bcbb175bc111fe0b8eed2f384ff53b}{rs\+\_\+trace\+\_\+stderr}}.

The trace callback may be changed at runtime with \mbox{\hyperlink{librsync_8h_a03b75bac7cfb13233f0a030d723d112a}{rs\+\_\+trace\+\_\+to}}.

Messages from librsync are labelled with a severity indicator of enumerated type \mbox{\hyperlink{librsync_8h_aacedf9be8d9837fcf7f5f1cbf37126ff}{rs\+\_\+loglevel}}.

The application may also specify a minimum severity of interest through \mbox{\hyperlink{librsync_8h_ae4427ad71847687ea6465d41f8209532}{rs\+\_\+trace\+\_\+set\+\_\+level}}. Messages lower than the specified level are discarded without being passed to the trace callback. 