summaryrefslogtreecommitdiffstats
path: root/pcilib/error.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-04-30 19:51:49 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-04-30 19:51:49 +0200
commit8da61292f595c5e700a4fef981b0e0d07910b4b2 (patch)
treea012e6312d95d50c3e8bd58bc972dbccdd3bd0bf /pcilib/error.c
parenta740fcee56bd456a759e03526df476e1791fb2bd (diff)
downloadpcitool-8da61292f595c5e700a4fef981b0e0d07910b4b2.tar.gz
pcitool-8da61292f595c5e700a4fef981b0e0d07910b4b2.tar.bz2
pcitool-8da61292f595c5e700a4fef981b0e0d07910b4b2.tar.xz
pcitool-8da61292f595c5e700a4fef981b0e0d07910b4b2.zip
Provide an interface for logging debug messages
Diffstat (limited to 'pcilib/error.c')
-rw-r--r--pcilib/error.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pcilib/error.c b/pcilib/error.c
index 538534b..ad38622 100644
--- a/pcilib/error.c
+++ b/pcilib/error.c
@@ -19,13 +19,19 @@ static pcilib_logger_t pcilib_logger = pcilib_print_error;
void pcilib_log_message(const char *file, int line, pcilib_log_priority_t prio, const char *msg, ...) {
va_list va;
- if (prio >= pcilib_logger_min_prio) {
+ if ((!prio)||(prio >= pcilib_logger_min_prio)) {
va_start(va, msg);
pcilib_logger(pcilib_logger_argument, file, line, prio, msg, va);
va_end(va);
}
}
+void pcilib_log_vmessage(const char *file, int line, pcilib_log_priority_t prio, const char *msg, va_list va) {
+ if ((!prio)||(prio >= pcilib_logger_min_prio)) {
+ pcilib_logger(pcilib_logger_argument, file, line, prio, msg, va);
+ }
+}
+
int pcilib_set_logger(pcilib_log_priority_t min_prio, pcilib_logger_t logger, void *arg) {
pcilib_logger_min_prio = min_prio;