Whole document tree
    

Whole document tree

GPhoto2-Port-Log

GPhoto2-Port-Log

Name

GPhoto2-Port-Log -- 

Description

Details

enum GPLogLevel

typedef enum {
	GP_LOG_ERROR = 0,
	GP_LOG_VERBOSE = 1,
	GP_LOG_DEBUG = 2,
	GP_LOG_DATA = 3
} GPLogLevel;


GPLogFunc ()

void        (*GPLogFunc)                    (GPLogLevel level,
                                             const char *domain,
                                             const char *format,
                                             va_list args,
                                             void *data);


gp_log_add_func ()

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).


gp_log_remove_func ()

int         gp_log_remove_func              (int id);

Removes the log function with given id.


gp_log ()

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.


gp_logv ()

void        gp_logv                         (GPLogLevel level,
                                             const char *domain,
                                             const char *format,
                                             va_list args);

Logs a message at the given log level. You would normally use this function to log as yet unformatted strings.


gp_log_data ()

void        gp_log_data                     (const char *domain,
                                             const char *data,
                                             unsigned int size);

Takes the data and creates a formatted hexdump string. If you would like to log text messages, use gp_log instead.


GP_LOG()

#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().


GP_DEBUG()

#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().