![]() | ![]() | ![]() | GPhoto2-Port API Reference Manual | ![]() |
---|
enum GPLogLevel; void (*GPLogFunc) (GPLogLevel level, const char *domain, const char *format, va_list args, void *data); int gp_log_add_func (GPLogLevel level, GPLogFunc func, void *data); int gp_log_remove_func (int id); void gp_log (GPLogLevel level, const char *domain, const char *format); #define gp_logv (level, domain, format, args) #define gp_log_data (domain, data, size) #define GP_LOG (level, msg, params...) #define GP_DEBUG (msg, params...)
typedef enum { GP_LOG_ERROR = 0, GP_LOG_VERBOSE = 1, GP_LOG_DEBUG = 2, GP_LOG_DATA = 3 } GPLogLevel;
void (*GPLogFunc) (GPLogLevel level, const char *domain, const char *format, va_list args, void *data);
level : | |
domain : | |
format : | |
args : | |
data : |
|
int gp_log_add_func (GPLogLevel level, GPLogFunc func, void *data);
Adds a log function that will be called for each log message that is flagged
with a log level that appears in given log level
. This function returns
an id that you can use for removing the log function again (using
gp_log_remove_func).
level : | |
func : | |
data : | data |
Returns : | an id or a gphoto2 error code |
int gp_log_remove_func (int id);
Removes the log function with given id
.
id : | an id (return value of gp_log_add_func) |
Returns : | a gphoto2 error code |
void gp_log (GPLogLevel level, const char *domain, const char *format);
Logs a message at the given log level
. You would normally use this
function to log strings.
level : | gphoto2 log level |
domain : | the domain |
format : | the format |
#define gp_logv(level, domain, format, args)
Logs a message at the given log level
. You would normally use this
function to log as yet unformatted strings.
level : | gphoto2 log level |
domain : | the domain |
format : | the format |
args : | the va_list corresponding to |
#define gp_log_data(domain, data, size)
Takes the data
and creates a formatted hexdump string. If you would like
to log text messages, use gp_log instead.
domain : | the domain |
data : | the data to be logged |
size : | the size of the |
#define GP_LOG(level, msg, params...)
Calls gp_log with an automatically generated domain.
You have to define GP_MODULE as "mymod" for your module
mymod before you can use #GP_LOG()
.
level : | gphoto2 log level to log message under |
msg : | message to log |
params... : |
|
#define GP_DEBUG(msg, params...)
Logs message at log level GP_LOG_DEBUG by calling #gp_log()
with
an automatically generated domain
You have to define GP_MODULE as "mymod" for your module
mymod before using #GP_DEBUG()
.
msg : | message to log |
params... : |
|
<<< GPhoto2-Port Core Reference | GPhoto2-Port-Result >>> |