=head1 NAME

nbdkit_debug, nbdkit_vdebug - print debugging messages for nbdkit

=head1 SYNOPSIS

 #include <nbdkit-plugin.h>

 void nbdkit_debug (const char *fs, ...);
 void nbdkit_vdebug (const char *fs, va_list args);

=head1 DESCRIPTION

Use C<nbdkit_debug> or C<nbdkit_vdebug> to print debug messages from
your plugin or filter.

These functions send the debug message to stderr.  Debug messages are
only emitted when the server is in verbose mode (nbdkit I<-v> option)

C<nbdkit_debug> works like L<printf(3)>.  C<nbdkit_vdebug> works like
L<vprintf(3)>.

For convenience both these functions preserve the value of C<errno>,
and also support the glibc extension of a single C<%m> in a format
string expanding to C<strerror(errno)>, even on platforms that don't
support that natively.

=head1 LANGUAGE BINDINGS

In L<nbdkit-golang-plugin(3)>:

 import "libguestfs.org/nbdkit"
 nbdkit.Debug(msg)

In L<nbdkit-ocaml-plugin(3)>:

 NBDKit.debug : ('a, unit, string, unit) format4 -> 'a

In L<nbdkit-perl-plugin(3)>:

 Nbdkit::debug ($msg);

In L<nbdkit-python-plugin(3)>:

 import nbdkit
 nbdkit.debug(str)

In L<nbdkit-rust-plugin(3)>:

 use nbdkit::*;
 debug!(fs, ...);

=head1 HISTORY

C<nbdkit_debug> was present in nbdkit 0.1.0.

=head1 SEE ALSO

L<nbdkit(1)>,
L<nbdkit_debug_hexdump(3)>,
L<nbdkit_error(3)>,
L<nbdkit-plugin(3)>,
L<nbdkit-filter(3)>.

=head1 AUTHORS

Richard W.M. Jones

=head1 COPYRIGHT

Copyright Red Hat
