GPhoto2-Port-Log

Name

GPhoto2-Port-Log -- 

Synopsis



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

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

level :

domain :

format :

args :

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

level :

a GPLogLevel

func :

a GPLogFunc

data :

data

Returns :

an id or a gphoto2 error code


gp_log_remove_func ()

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


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.

level :

gphoto2 log level

domain :

the domain

format :

the format


gp_logv()

#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 format


gp_log_data()

#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 data


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

level :

gphoto2 log level to log message under

msg :

message to log

params... :


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

msg :

message to log

params... :