The main way to debug libfolks (or applications using it) is using the G_MESSAGES_DEBUG environment variable. For example, to collect a log file of all libfolks debug data from Empathy, use the command:

FOLKS_DEBUG_NO_COLOUR=1 G_MESSAGES_DEBUG=all empathy &> folks.log

Available values for folks for the G_MESSAGES_DEBUG environment variable are:

Multiple values can be specified using commas, e.g.: G_MESSAGES_DEBUG=folks,eds,key-file.

Another way to debug libfolks itself is to run the folks-inspect utility which is bundled with libfolks (possibly in a utils or tools package, depending on your distribution). Its use is beyond the scope of this page, but it has a help command which should serve as an introduction.

Finally, libfolks has a status printing mechanism. Some libfolks clients may expose this as part of their own debug functionality (for example, folks-inspect uses this for its debug command), but it can be invoked more generally using gdb:

set $folks_debug = folks_debug_dup()
call folks_debug_emit_print_status($folks_debug)

This will print out a listing of the state of all the objects relevant to libfolks' linking decisions.

Finally, libfolks outputs debug and status information using terminal colours and formatting by default. If this isn't desired, set the FOLKS_DEBUG_NO_COLOUR environment variable.