#include <stdarg.h>
Include dependency graph for gphoto2-port-log.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | GP_LOG_ALL GP_LOG_DATA |
Typedefs | |
typedef void(*) | GPLogFunc (GPLogLevel level, const char *domain, const char *format, va_list args, void *data) |
Logging function hook. | |
Enumerations | |
enum | GPLogLevel { GP_LOG_ERROR = 0, GP_LOG_VERBOSE = 1, GP_LOG_DEBUG = 2, GP_LOG_DATA = 3 } |
Logging level Specifies the logging severity level. More... | |
Functions | |
int | gp_log_add_func (GPLogLevel level, GPLogFunc func, void *data) |
Add a function to get logging information. | |
int | gp_log_remove_func (int id) |
Remove a logging receiving function. | |
void | gp_log (GPLogLevel level, const char *domain, const char *format,...) |
Log a debug or error message. | |
void | gp_logv (GPLogLevel level, const char *domain, const char *format, va_list args) |
Log a debug or error message with va_list. | |
void | gp_log_data (const char *domain, const char *data, unsigned int size) |
Log data domain the domain data the data to be logged size the size of the data. |
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define GP_LOG_ALL GP_LOG_DATA |
GP_LOG_ALL:
Used by frontends if they want to be sure their callback function receives all messages. Defined as the highest debug level. Can make frontend code more understandable and extension of log levels easier.
typedef void(* ) GPLogFunc(GPLogLevel level, const char *domain, const char *format, va_list args, void *data) |
Logging function hook.
This is the function frontends can use to receive logging information from the libgphoto2 framework. It is set using gp_log_add_func() and removed using gp_log_remove_func() and will then receive the logging messages of the level specified.
level | the log level of the passed message, as set by the camera driver or libgphoto2 | |
domain | the logging domain as set by the camera driver, or libgphoto2 function | |
format | the printf style format string of the logmessage, without linefeed | |
args | the arguments as va_list, depending on the format string | |
data | the caller private data that was passed to gp_log_add_func() |
enum GPLogLevel |
void gp_log | ( | GPLogLevel | level, | |
const char * | domain, | |||
const char * | format, | |||
... | ||||
) |
Log a debug or error message.
level | gphoto2 log level | |
domain | the log domain | |
format | a printf style format string | |
... | the variable argumentlist for above format string |
int gp_log_add_func | ( | GPLogLevel | level, | |
GPLogFunc | func, | |||
void * | data | |||
) |
Add a function to get logging information.
level | the maximum level of logging it will get, up to and including the passed value | |
func | a GPLogFunc | |
data | data |
void gp_log_data | ( | const char * | domain, | |
const char * | data, | |||
unsigned int | size | |||
) |
Log data domain the domain data the data to be logged size the size of the data.
Takes the data and creates a formatted hexdump string. If you would like to log text messages, use gp_log instead.
int gp_log_remove_func | ( | int | id | ) |
Remove a logging receiving function.
id | an id (return value of gp_log_add_func) |
void gp_logv | ( | GPLogLevel | level, | |
const char * | domain, | |||
const char * | format, | |||
va_list | args | |||
) |
Log a debug or error message with va_list.
level | gphoto2 log level | |
domain | the domain | |
format | the format | |
args | the va_list corresponding to format |