changeset 23:76613e8f8db9

Use VANESSA_LOGGER_ macros. Compatible with BDB 4.1. Other minor fixes
author Simon Horman <horms@verge.net.au>
date Tue, 16 Dec 2003 13:01:31 +0900
parents 7e1318da6d12
children bbaec338e783
files configure.in pbs/pbs.c pbs/pbs_db.c pbs/pbs_log.h pbs/pbs_option.c pbs/pbs_record.c pbs/pbs_record_db.c
diffstat 7 files changed, 125 insertions(+), 133 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Sun Oct 19 14:16:57 2003 +0900
+++ b/configure.in	Tue Dec 16 13:01:31 2003 +0900
@@ -63,6 +63,21 @@
 AC_FUNC_STRFTIME
 AC_CHECK_FUNCS([localtime_r memset regcomp setenv setlocale strcasecmp strchr strerror])
 
+# More BDB Stupidity.
+# It seems that function call arguments actually vary between versions.
+# Why do we use this crap anyway?
+
+AC_MSG_CHECKING("For Berkley DB Version 4.1 and above");
+AC_TRY_RUN(
+	[ #include <db.h>
+		int main(int arc, char **argv) {
+		exit((DB_VERSION_MAJOR>=4 && DB_VERSION_MINOR>=1)?0:1);} ],
+	[ AC_DEFINE(HAVE_BDB_4_1, 1, Berkely DB Version 4.1 and above)
+		AC_MSG_RESULT("yes") ],
+	[ AC_MSG_RESULT("no") ]
+)
+
+
 ######################################################################
 # Dmalloc debugging
 
--- a/pbs/pbs.c	Sun Oct 19 14:16:57 2003 +0900
+++ b/pbs/pbs.c	Tue Dec 16 13:01:31 2003 +0900
@@ -103,8 +103,8 @@
 
 	opt = pbs_options_parse(argc, argv);
 	if(opt == NULL) {
-		PBS_DEBUG("pbs_options_parse");	
-		PBS_ERR("Fatal error parsing options. Exiting");
+		VANESSA_LOGGER_DEBUG("pbs_options_parse");	
+		VANESSA_LOGGER_ERR("Fatal error parsing options. Exiting");
 		goto leave;
 	}
 
@@ -163,8 +163,8 @@
 	}
 
 	if(!geteuid() && vanessa_socket_daemon_setid(opt->user, opt->group)){
-		PBS_DEBUG("vanessa_socket_daemon_setid");
-		PBS_ERR("Fatal error setting group and userid. Exiting.");
+		VANESSA_LOGGER_DEBUG("vanessa_socket_daemon_setid");
+		VANESSA_LOGGER_ERR("Fatal error setting group and userid. Exiting.");
 		vanessa_socket_daemon_exit_cleanly(-1);
 	}
 
@@ -193,16 +193,17 @@
 	signal(SIGIO,     pbs_exit_handler);
 
 	if(regcomp(&pregex, opt->regex, REG_EXTENDED|REG_NEWLINE) != 0) {
-		PBS_DEBUG_ERRNO("regcomp");
-		PBS_ERR_UNSAFE("Fatal error compiling regular expression "
-				"\"%s\". Exiting");
+		VANESSA_LOGGER_DEBUG_ERRNO("regcomp");
+		VANESSA_LOGGER_ERR_UNSAFE("Fatal error compiling regular "
+				"expression \"%s\". Exiting",
+				opt->regex);
 		goto leave;
 	}
 
 	db = pbs_db_open(opt->db_filename, 0664);
 	if(db == NULL) {
-		PBS_DEBUG("pbs_db_open");
-		PBS_ERR_UNSAFE("Fatal error opening database \"%s\". Exiting",
+		VANESSA_LOGGER_DEBUG("pbs_db_open");
+		VANESSA_LOGGER_ERR_UNSAFE("Fatal error opening database \"%s\". Exiting",
 				opt->db_filename);
 		goto leave;
 	}
@@ -210,12 +211,12 @@
 	if(opt->mode == PBS_MODE_SETENV) {
 		status = do_mode_setenv(db, 1, opt->prefix, opt->leftover);
 		if(status == -2) {
-			PBS_ERR("There must be at least one argument "
+			VANESSA_LOGGER_ERR("There must be at least one argument "
 					"to setenv");
 		}
 		else if(status < 0) {
-			PBS_DEBUG("do_mode_setenv");
-			PBS_ERR("Fatal error doing setenv. Exiting");
+			VANESSA_LOGGER_DEBUG("do_mode_setenv");
+			VANESSA_LOGGER_ERR("Fatal error doing setenv. Exiting");
 		}
 		goto leave;
 		goto leave;
@@ -223,8 +224,8 @@
 
 	if(opt->mode == PBS_MODE_LIST) {
 		if(do_mode_list(db, opt->leftover, opt->prefix) < 0) {
-			PBS_DEBUG("do_mode_list");
-			PBS_ERR("Fatal error listing database. Exiting");
+			VANESSA_LOGGER_DEBUG("do_mode_list");
+			VANESSA_LOGGER_ERR("Fatal error listing database. Exiting");
 		}
 		goto leave;
 	}
@@ -234,11 +235,11 @@
 					opt->timeout, 
 					opt->log_level==PBS_LOG_LEVEL_QUIET);
 		if(status == -2) {
-			PBS_ERR("There must be at least one key to insert");
+			VANESSA_LOGGER_ERR("There must be at least one key to insert");
 		}
 		else if(status < 0) {
-			PBS_DEBUG("do_mode_insert");
-			PBS_ERR("Fatal error inserting entries. Exiting");
+			VANESSA_LOGGER_DEBUG("do_mode_insert");
+			VANESSA_LOGGER_ERR("Fatal error inserting entries. Exiting");
 		}
 		goto leave;
 	}
@@ -247,11 +248,11 @@
 		status = do_mode_remove(db, opt->leftover, opt->prefix, 
 					opt->log_level==PBS_LOG_LEVEL_QUIET);
 		if(status == -2) {
-			PBS_ERR("There must be at least one key to remove");
+			VANESSA_LOGGER_ERR("There must be at least one key to remove");
 		}
 		else if(status < 0) {
-			PBS_DEBUG("do_mode_insert");
-			PBS_ERR("Fatal error inserting entries. Exiting");
+			VANESSA_LOGGER_DEBUG("do_mode_insert");
+			VANESSA_LOGGER_ERR("Fatal error inserting entries. Exiting");
 		}
 		goto leave;
 	}
@@ -259,30 +260,30 @@
 	if(opt->mode == PBS_MODE_PURGE) {
 		if(do_mode_purge(db, 
 				opt->log_level==PBS_LOG_LEVEL_QUIET) < 0) {
-			PBS_DEBUG("do_mode_purge");
-			PBS_ERR("Fatal error purging database. Exiting");
+			VANESSA_LOGGER_DEBUG("do_mode_purge");
+			VANESSA_LOGGER_ERR("Fatal error purging database. Exiting");
 		}
 		goto leave;
 	}
 
 	fd = pbs_file_open(opt->log_filename, 0);
 	if(fd < 0) {
-		PBS_DEBUG_UNSAFE("pbs_file_open \"%s\"", opt->log_filename);	
-		PBS_ERR_UNSAFE("Fatal error opening log file \"%s\". Exiting",
+		VANESSA_LOGGER_DEBUG_UNSAFE("pbs_file_open \"%s\"", opt->log_filename);	
+		VANESSA_LOGGER_ERR_UNSAFE("Fatal error opening log file \"%s\". Exiting",
 				opt->log_filename);
 		goto leave;
 	}
 
 	if(fstat(fd, &stat_buf) < 0) {
-		PBS_DEBUG_ERRNO("fstat");
-		PBS_ERR("Fatal error determining log size. Exiting");
+		VANESSA_LOGGER_DEBUG_ERRNO("fstat");
+		VANESSA_LOGGER_ERR("Fatal error determining log size. Exiting");
 		goto leave;
 	}
 	file_size=stat_buf.st_size;
 
 	while(1) {
 		if(pbs_exit_now) {
-			PBS_ERR_UNSAFE("Exiting on Signal %d", pbs_exit_now);
+			VANESSA_LOGGER_ERR_UNSAFE("Exiting on Signal %d", pbs_exit_now);
 			goto leave;
 		}
 
@@ -291,10 +292,10 @@
 			if(pbs_db_traverse(db, 
 					pbs_db_traverse_func_expire_record, 
 					&now) < 0) {
-				PBS_DEBUG("pbs_db_traverse "
+				VANESSA_LOGGER_DEBUG("pbs_db_traverse "
 						"pbs_db_expire_record");
 
-				PBS_ERR("Fatal error expiring keys from "
+				VANESSA_LOGGER_ERR("Fatal error expiring keys from "
 						"database. Exiting");
 				goto leave;
 			}
@@ -302,8 +303,8 @@
 		}
 
 		if(fstat(fd, &stat_buf) < 0) {
-			PBS_DEBUG_ERRNO("fstat");
-			PBS_ERR("Fatal error determining log size. "
+			VANESSA_LOGGER_DEBUG_ERRNO("fstat");
+			VANESSA_LOGGER_ERR("Fatal error determining log size. "
 					"Exiting");
 			goto leave;
 		}
@@ -311,18 +312,18 @@
 		file_size=stat_buf.st_size;
 
 		if(pbs_reread_now || old_file_size > file_size) {
-			PBS_INFO_UNSAFE("Reopening log file \"%s\"", 
+			VANESSA_LOGGER_INFO_UNSAFE("Reopening log file \"%s\"", 
 					opt->log_filename);
 			if(close(fd) < 0) {
-				PBS_DEBUG_ERRNO("close");
-				PBS_ERR("Fatal error closing log file. "
+				VANESSA_LOGGER_DEBUG_ERRNO("close");
+				VANESSA_LOGGER_ERR("Fatal error closing log file. "
 						"Exiting");
 				goto leave;
 			}
 			fd =pbs_file_open(opt->log_filename, 1);
 			if(fd < 0) {
-				PBS_DEBUG("pbs_file_open");	
-				PBS_ERR("Fatal error opening log file. "
+				VANESSA_LOGGER_DEBUG("pbs_file_open");	
+				VANESSA_LOGGER_ERR("Fatal error opening log file. "
 						"Exiting");
 				goto leave;
 			}
@@ -338,8 +339,8 @@
 		while(1) {
 			status = pbs_read_line(fd, &line);
 			if(status < 0) {
-				PBS_DEBUG("pbs_read_line");
-				PBS_ERR("Fatal error reading log file. "
+				VANESSA_LOGGER_DEBUG("pbs_read_line");
+				VANESSA_LOGGER_ERR("Fatal error reading log file. "
 						"Exiting");
 				goto leave;
 			}
@@ -351,8 +352,8 @@
 			}
 			if(pbs_consume_line(&pregex, line, db, opt->timeout,
 					opt->prefix) < 0) {
-				PBS_DEBUG("pbs_consume_line");
-				PBS_ERR("Fatal error processing line from "
+				VANESSA_LOGGER_DEBUG("pbs_consume_line");
+				VANESSA_LOGGER_ERR("Fatal error processing line from "
 						"log file. Exiting");
 				goto leave;
 			}
@@ -381,13 +382,13 @@
 			break;
 		}
 
-		PBS_DEBUG_ERRNO("open");	
+		VANESSA_LOGGER_DEBUG_ERRNO("open");	
 		if((errno != EACCES && errno != ENOENT && errno != ELOOP)
 				|| !retry) {
 			return(-1);
 		}
 		
-		PBS_ERR_UNSAFE("Transient error opening file, will retry "
+		VANESSA_LOGGER_ERR_UNSAFE("Transient error opening file, will retry "
 				"in %d seconds\n", pause);	
 		sleep(pause);
 		if(pbs_exit_now) {
@@ -400,7 +401,7 @@
 	}
 
 	if(lseek(fd, 0, SEEK_END) < 0) {
-		PBS_DEBUG_ERRNO("fstat");
+		VANESSA_LOGGER_DEBUG_ERRNO("fstat");
 		return(-1);
 	}
 
@@ -421,7 +422,7 @@
 	__pbs_read_line_bytes = read(fd, __pbs_read_line_buffer, 
 			PBS_BUFFER_SIZE-1);
 	if(__pbs_read_line_bytes < 0) {
-		PBS_DEBUG_ERRNO("read");
+		VANESSA_LOGGER_DEBUG_ERRNO("read");
 		return(-1);
 	}
 	__pbs_read_line_offset = 0;
@@ -441,7 +442,7 @@
 	
 	bytes = fill_buffer(fd, &this_line);
 	if(bytes < 0) {
-		PBS_DEBUG("fill_buffer");
+		VANESSA_LOGGER_DEBUG("fill_buffer");
 		return(-1);
 	}
 	if(bytes == 0) {
@@ -455,7 +456,7 @@
 	
 	*current = realloc(*current, alloc_length + 1);
 	if(*current == NULL) {
-		PBS_DEBUG_ERRNO("realloc");
+		VANESSA_LOGGER_DEBUG_ERRNO("realloc");
 		return(-1);
 	}
 
@@ -495,14 +496,14 @@
 	
 	if(pmatch[1].rm_so == -1 || pmatch[1].rm_eo == -1 ||
 			pmatch[1].rm_so >= pmatch[1].rm_eo) {
-		PBS_DEBUG("ip not found");
+		VANESSA_LOGGER_DEBUG("ip not found");
 		return(-1);
 	}
 	len = pmatch[1].rm_eo - pmatch[1].rm_so;
 	prefix_len=(prefix != NULL)?strlen(prefix):0;
 	ip = malloc(len + +prefix_len + 1);
 	if(ip == NULL) {
-		PBS_DEBUG_ERRNO("malloc ip");
+		VANESSA_LOGGER_DEBUG_ERRNO("malloc ip");
 		return(-1);
 	}
 	memset(ip, '\0', len + prefix_len + 1);
@@ -517,7 +518,7 @@
 		user = malloc(len + 1);
 		if(user == NULL) {
 			free(ip);
-			PBS_DEBUG_ERRNO("malloc user");
+			VANESSA_LOGGER_DEBUG_ERRNO("malloc user");
 			return(-1);
 		}
 		memset(user, '\0', len+1);
@@ -526,11 +527,11 @@
 
 	expire = time(NULL) + timeout;
 	if(pbs_record_db_put(db, ip, prefix, expire, ip) < 0) {
-		PBS_DEBUG("pbs_record_store");
+		VANESSA_LOGGER_DEBUG("pbs_record_store");
 		status = -1;
 	}
 
-	PBS_INFO_UNSAFE("Added: \"%s\" for \"%s\"\n", ip, user);
+	VANESSA_LOGGER_INFO_UNSAFE("Added: \"%s\" for \"%s\"\n", ip, user);
 
 	free(ip);
 	free(user);
@@ -553,14 +554,14 @@
 	width = pbs_key_width(prefix);
 
 	if(pbs_record_top(width) < 0) {
-		PBS_DEBUG("pbs_record_hrule");
+		VANESSA_LOGGER_DEBUG("pbs_record_hrule");
 		return(-1);
 	}
 
 	if(key == NULL) {
 		if(pbs_db_traverse(db, pbs_db_traverse_func_show_record, 
 					&width) < 0) {
-			PBS_DEBUG("pbs_db_traverse pbs_db_show_record");
+			VANESSA_LOGGER_DEBUG("pbs_db_traverse pbs_db_show_record");
 			return(-1);
 		}
 		return(0);
@@ -589,14 +590,14 @@
 	char *response;
 
 	if(key == NULL) {
-		PBS_DEBUG("no key");
+		VANESSA_LOGGER_DEBUG("no key");
 		return(-2);
 	}
 
 	width = pbs_key_width(prefix);
 
 	if(!quiet && pbs_record_top(width) < 0) {
-		PBS_DEBUG("pbs_record_hrule");
+		VANESSA_LOGGER_DEBUG("pbs_record_hrule");
 		return(-1);
 	}
 
@@ -623,21 +624,21 @@
 	const char **k;
 
 	if(key == NULL) {
-		PBS_DEBUG("no key");
+		VANESSA_LOGGER_DEBUG("no key");
 		return(-2);
 	}
 
 	width = pbs_key_width(prefix);
 
 	if(!quiet && pbs_record_top(width) < 0) {
-		PBS_DEBUG("pbs_record_hrule");
+		VANESSA_LOGGER_DEBUG("pbs_record_hrule");
 		return(-1);
 	}
 
 	expire = time(NULL) + timeout;
 	for(k = key ; *k != NULL; k++) {
 		if(pbs_record_db_put(db, *k, prefix, expire, *k) < 0) {
-			PBS_DEBUG("pbs_record_store");
+			VANESSA_LOGGER_DEBUG("pbs_record_store");
 			return(-1);
 		}
 		if(!quiet) {
@@ -656,7 +657,7 @@
 
 	if(pbs_db_traverse(db, pbs_db_traverse_func_expire_record, 
 				&expire) < 0) {
-		PBS_DEBUG("pbs_db_traverse "
+		VANESSA_LOGGER_DEBUG("pbs_db_traverse "
 				"pbs_db_expire_record");
 		return(-1);
 	}
@@ -682,7 +683,7 @@
 	size_t buf_len = 0;
 
 	if(argv == NULL) {
-		PBS_DEBUG("no arguments");
+		VANESSA_LOGGER_DEBUG("no arguments");
 		return(-2);
 	}
 
@@ -690,12 +691,12 @@
 	if(peername_str == NULL) {
 		namelen = sizeof(peername);
 		if(getpeername(fd, (struct sockaddr *)&peername, &namelen)) {
-			PBS_DEBUG_ERRNO("getpeername");
+			VANESSA_LOGGER_DEBUG_ERRNO("getpeername");
 			return(-1);
 		}
 		peername_str = inet_ntoa(peername.sin_addr);
 		if(peername_str == NULL) {
-			PBS_DEBUG_ERRNO("inet_ntoa");
+			VANESSA_LOGGER_DEBUG_ERRNO("inet_ntoa");
 			return(-1);
 		}
 	}
@@ -703,20 +704,20 @@
 	peername_str_fixed = pbs_record_fix_key(peername_str, prefix, 
 			&buf, &buf_len);
 	if(peername_str_fixed == NULL) {
-		PBS_DEBUG("pbs_record_fix_key");
+		VANESSA_LOGGER_DEBUG("pbs_record_fix_key");
 		return(-1);
 	}
 
 	now = time(NULL);
 	if(pbs_record_db_get(db, peername_str_fixed, prefix,
 			&expire, NULL, NULL) < 0) {
-		PBS_INFO_UNSAFE("No (Not in database): %s", peername_str);
+		VANESSA_LOGGER_INFO_UNSAFE("No (Not in database): %s", peername_str);
 	}
 	else if (difftime(now, expire) > 0) {
-		PBS_INFO_UNSAFE("No (Expired): %s", peername_str);
+		VANESSA_LOGGER_INFO_UNSAFE("No (Expired): %s", peername_str);
 	}
 	else {
-		PBS_INFO_UNSAFE("Yes: %s, peername_str");
+		VANESSA_LOGGER_INFO_UNSAFE("Yes: %s", peername_str);
 		setenv("RELAYCLIENT", &value, 0);
 	}
 
@@ -725,6 +726,6 @@
 	}
 
 	execv(argv[0], (char **const)argv);
-	PBS_DEBUG_ERRNO("execl");	
+	VANESSA_LOGGER_DEBUG_ERRNO("execl");	
 	return(-1);
 }
--- a/pbs/pbs_db.c	Sun Oct 19 14:16:57 2003 +0900
+++ b/pbs/pbs_db.c	Tue Dec 16 13:01:31 2003 +0900
@@ -46,14 +46,18 @@
 
 	status = db_create(&dbp, NULL, 0);
 	if(status != 0) {
-		PBS_DEBUG_DB("db_create", status);
+		VANESSA_LOGGER_DEBUG_DB("db_create", status);
 		return(NULL);
 	}
 	
 
-	status = dbp->open(dbp, filename, NULL, DB_HASH, DB_CREATE, mode);
+	status = dbp->open(dbp, 
+#ifdef HAVE_BDB_4_1
+		      	NULL,
+#endif
+	  		filename, NULL, DB_HASH, DB_CREATE, mode);
 	if(status != 0) {
-		PBS_DEBUG_DB("dbp->open", status);
+		VANESSA_LOGGER_DEBUG_DB("dbp->open", status);
 		dbp->close(dbp, 0);
 		return(NULL);
 	}
@@ -68,7 +72,7 @@
 	dbp = (DB *)db;
 	status = dbp->close(dbp, 0);
 	if(status != 0) {
-		PBS_DEBUG_DB("dbp->close", status);
+		VANESSA_LOGGER_DEBUG_DB("dbp->close", status);
 		return(-1);
 	}
 
@@ -82,7 +86,7 @@
 	dbp = (DB *)db;
 	status = dbp->sync(dbp, 0);
 	if(status != 0) {
-		PBS_DEBUG_DB("dbp->sync", status);
+		VANESSA_LOGGER_DEBUG_DB("dbp->sync", status);
 		return(-1);
 	}
 
@@ -109,7 +113,7 @@
 
 	status = dbp->put(dbp, NULL, &keyp, &datap, 0);
 	if(status != 0) {
-		PBS_DEBUG_DB("dbp->put", status);
+		VANESSA_LOGGER_DEBUG_DB("dbp->put", status);
 		return(-1);
 	}
 
@@ -136,7 +140,7 @@
 	if(status != 0) {
 		*data = NULL;
 		*data_len = 0;
-		PBS_DEBUG_DB("dbp->get", status);
+		VANESSA_LOGGER_DEBUG_DB("dbp->get", status);
 		return(-1);
 	}
 
@@ -160,7 +164,7 @@
 
 	status = dbp->del(dbp, NULL, &keyp, 0);
 	if(status != 0) {
-		PBS_DEBUG_DB("dbp->get", status);
+		VANESSA_LOGGER_DEBUG_DB("dbp->get", status);
 		return(-1);
 	}
 
@@ -183,7 +187,7 @@
 
 	status = dbp->cursor(dbp, NULL, &cursorp, 0);
 	if(status != 0) {
-		PBS_DEBUG_DB("db->cursor", status);
+		VANESSA_LOGGER_DEBUG_DB("db->cursor", status);
 		return(-1);
 	}
 
@@ -196,14 +200,14 @@
 			break;
 		}
 		else if(status != 0) {
-			PBS_DEBUG_DB("cursor->c_get", status);
+			VANESSA_LOGGER_DEBUG_DB("cursor->c_get", status);
 			return_status = -1;
 			break;
 		}
 
 		if(func(cursorp, keyp.data, keyp.size, datap.data, datap.size,
 					func_data) < 0) {
-			PBS_DEBUG("func");
+			VANESSA_LOGGER_DEBUG("func");
 			return_status=-1;
 			break;
 		}
@@ -211,7 +215,7 @@
 
 	status = cursorp->c_close(cursorp);
 	if(status != 0) {
-		PBS_DEBUG_DB("cursor->c_close", status);
+		VANESSA_LOGGER_DEBUG_DB("cursor->c_close", status);
 		return_status = -1;
 	}
 	
@@ -230,7 +234,7 @@
 	width=(func_data==NULL)?0:*(int *)func_data;
 
 	if(pbs_record_show(ip, time, width) < 0) {
-		PBS_DEBUG("pbs_record_show");
+		VANESSA_LOGGER_DEBUG("pbs_record_show");
 		return(-1);
 	}
 
@@ -260,11 +264,11 @@
 
 	status = cursorp->c_del(cursorp, 0);
 	if(status != 0) {
-		PBS_DEBUG_DB("cursor->c_del", status);
+		VANESSA_LOGGER_DEBUG_DB("cursor->c_del", status);
 		return(-1);
 	}
 
-	PBS_INFO_UNSAFE("Expired %s\n", ip);
+	VANESSA_LOGGER_INFO_UNSAFE("Expired %s\n", ip);
 
 	return(0);
 }
--- a/pbs/pbs_log.h	Sun Oct 19 14:16:57 2003 +0900
+++ b/pbs/pbs_log.h	Tue Dec 16 13:01:31 2003 +0900
@@ -54,35 +54,7 @@
  * should be safe to use with user derived input.
  */
 
-#define PBS_LOG_UNSAFE(priority, fmt, args...) \
-  vanessa_logger_log(pbs_vl, priority, fmt, ## args)
-
-#define PBS_LOG(priority, str) \
-  vanessa_logger_log(pbs_vl, priority, "%s", str)
-
-#define PBS_INFO_UNSAFE(fmt, args...) \
-  vanessa_logger_log(pbs_vl, LOG_INFO, fmt, ## args)
-
-#define PBS_INFO(str) \
-  vanessa_logger_log(pbs_vl, LOG_INFO, "%s", str)
-
-#define PBS_ERR_UNSAFE(fmt, args...) \
-  vanessa_logger_log(pbs_vl, LOG_ERR, fmt, ## args)
-
-#define PBS_ERR(str) \
-  vanessa_logger_log(pbs_vl, LOG_ERR, "%s", str)
-
-#define PBS_DEBUG_UNSAFE(fmt, args...) \
-  vanessa_logger_log(pbs_vl, LOG_DEBUG, __FUNCTION__ ": " fmt, ## args)
-
-#define PBS_DEBUG(str) \
-  vanessa_logger_log(pbs_vl, LOG_DEBUG, __FUNCTION__ ": %s", str)
-
-#define PBS_DEBUG_ERRNO(s) \
-  vanessa_logger_log(pbs_vl, LOG_DEBUG, "%s: %s: %s", \
-    __FUNCTION__, s, strerror(errno))
-
-#define PBS_DEBUG_DB(s, err) \
+#define VANESSA_LOGGER_DEBUG_DB(s, err) \
   vanessa_logger_log(pbs_vl, LOG_DEBUG, "%s: %s: %s", \
     __FUNCTION__, s, pbs_db_strerror(err))
 
--- a/pbs/pbs_option.c	Sun Oct 19 14:16:57 2003 +0900
+++ b/pbs/pbs_option.c	Tue Dec 16 13:01:31 2003 +0900
@@ -102,7 +102,7 @@
 
 	opt = malloc(sizeof(pbs_options_t));
 	if(opt == NULL) {
-		PBS_DEBUG_ERRNO("malloc");	
+		VANESSA_LOGGER_DEBUG_ERRNO("malloc");	
 		return(NULL);
 	}
 
@@ -297,7 +297,7 @@
 }
 
 void pbs_options_log(pbs_options_t *opt){
-	PBS_INFO_UNSAFE(
+	VANESSA_LOGGER_INFO_UNSAFE(
 		"db_file=\"%s\" "
 		"debug=\"%s\" "
 		"group=\"%s\" "
@@ -344,7 +344,7 @@
 		return(PBS_MODE_SETENV);
 	}
 
-	PBS_DEBUG_UNSAFE("unknown mode: \"%s\"", mode);
+	VANESSA_LOGGER_DEBUG_UNSAFE("unknown mode: \"%s\"", mode);
 	return(-1);
 }
 
@@ -364,6 +364,6 @@
 		case PBS_MODE_SETENV:
 		      return(PBS_MODE_SETENV_STR);
 	}
-	PBS_DEBUG_UNSAFE("unkown mode: %d", mode);
+	VANESSA_LOGGER_DEBUG_UNSAFE("unkown mode: %d", mode);
 	return(NULL);
 }
--- a/pbs/pbs_record.c	Sun Oct 19 14:16:57 2003 +0900
+++ b/pbs/pbs_record.c	Tue Dec 16 13:01:31 2003 +0900
@@ -51,7 +51,7 @@
 	char buf[PBS_DATE_WIDTH];
 
 	if(localtime_r(&time, &tm) == NULL) {
-		PBS_DEBUG_ERRNO("localtime_r");
+		VANESSA_LOGGER_DEBUG_ERRNO("localtime_r");
 		return(-1);
 	}
 	strftime(buf, PBS_DATE_WIDTH-1, "%c", &tm);
@@ -67,7 +67,7 @@
 
 	buffer = malloc(rule_width+1);
 	if(buffer == NULL) {
-		PBS_DEBUG_ERRNO("malloc");
+		VANESSA_LOGGER_DEBUG_ERRNO("malloc");
 		return(-1);
 	}
 
@@ -88,11 +88,11 @@
 
 int pbs_record_top(size_t width) {
 	if(pbs_record_title(width) < 0) {
-		PBS_DEBUG("pbs_record_title");
+		VANESSA_LOGGER_DEBUG("pbs_record_title");
 		return(-1);
 	}
 	if(pbs_record_hrule(width) < 0) {
-		PBS_DEBUG("pbs_record_title");
+		VANESSA_LOGGER_DEBUG("pbs_record_title");
 		return(-1);
 	}
 
@@ -123,7 +123,7 @@
 
 	new_key = (char *)malloc(new_key_len);
 	if(new_key == NULL) {
-		PBS_DEBUG_ERRNO("realloc");
+		VANESSA_LOGGER_DEBUG_ERRNO("realloc");
 		return(NULL);
 	}
 	memset(new_key, 0, new_key_len);
@@ -149,7 +149,7 @@
 		*buf_len = prefix_len + k_len + 1;
 		*buf = realloc(*buf, *buf_len);
 		if(*buf == NULL) {
-			PBS_DEBUG_ERRNO("realloc");
+			VANESSA_LOGGER_DEBUG_ERRNO("realloc");
 			return(NULL);
 		}
 	}
--- a/pbs/pbs_record_db.c	Sun Oct 19 14:16:57 2003 +0900
+++ b/pbs/pbs_record_db.c	Tue Dec 16 13:01:31 2003 +0900
@@ -41,25 +41,25 @@
 
 	ip_fixed = pbs_record_fix_key(ip, prefix, &buf, &buf_len);
 	if(ip_fixed == NULL) {
-		PBS_DEBUG("pbs_record_fix_key");
+		VANESSA_LOGGER_DEBUG("pbs_record_fix_key");
 		goto leave;
 	}
 
 	time_ip = pbs_record_prefix_key(ip_fixed, PBS_TIME_PREFIX);
 	if(time_ip == NULL) {
-		PBS_DEBUG("pbs_record_prefix_key");
+		VANESSA_LOGGER_DEBUG("pbs_record_prefix_key");
 		goto leave;
 	}
 
 	if(pbs_db_put(db, (char *)ip_fixed, strlen(ip_fixed)+1,
 				(char *)status, strlen(status)+1) < 0) {
-		PBS_DEBUG("pbs_db_put");
+		VANESSA_LOGGER_DEBUG("pbs_db_put");
 		goto leave;
 	}
 
 	if(pbs_db_put(db, (void *)time_ip, strlen(time_ip)+1,
 				(void *)&expire, sizeof(expire)) < 0) {
-		PBS_DEBUG("pbs_db_put");
+		VANESSA_LOGGER_DEBUG("pbs_db_put");
 		pbs_db_del(db, (char *)ip_fixed, strlen(ip_fixed)+1);
 		goto leave;
 	}
@@ -89,14 +89,14 @@
 
 	ip_fixed = pbs_record_fix_key(ip, prefix, &buf, &buf_len);
 	if(ip_fixed == NULL) {
-		PBS_DEBUG("pbs_record_fix_key");
+		VANESSA_LOGGER_DEBUG("pbs_record_fix_key");
 		goto leave;
 	}
 
 	if(status != NULL && status_len != NULL) {
 		if(pbs_db_get(db, (void *)ip_fixed, strlen(ip_fixed)+1,
 					(void **)status, status_len) < 0) {
-			PBS_DEBUG("pbs_db_get");
+			VANESSA_LOGGER_DEBUG("pbs_db_get");
 			goto leave;
 		}
 		if(*status_len > 0) {
@@ -107,12 +107,12 @@
 	if(expire != NULL) {
 		time_ip = pbs_record_prefix_key(ip_fixed, PBS_TIME_PREFIX);
 		if(time_ip == NULL) {
-			PBS_DEBUG("pbs_record_prefix_key");
+			VANESSA_LOGGER_DEBUG("pbs_record_prefix_key");
 			goto leave;
 		}
 		if(pbs_db_get(db, (void *)time_ip, strlen(time_ip)+1,
 					(void **)&dummy, &dummy_len) < 0) {
-			PBS_DEBUG("pbs_db_get");
+			VANESSA_LOGGER_DEBUG("pbs_db_get");
 			goto leave;
 		}
 		*expire = *dummy;
@@ -140,23 +140,23 @@
 
 	ip_fixed = pbs_record_fix_key(ip, prefix, &buf, &buf_len);
 	if(ip_fixed == NULL) {
-		PBS_DEBUG("pbs_record_fix_key");
+		VANESSA_LOGGER_DEBUG("pbs_record_fix_key");
 		goto leave;
 	}
 
 	time_ip = pbs_record_prefix_key(ip_fixed, PBS_TIME_PREFIX);
 	if(time_ip == NULL) {
-		PBS_DEBUG("pbs_record_prefix_key");
+		VANESSA_LOGGER_DEBUG("pbs_record_prefix_key");
 		goto leave;
 	}
 
 	if(pbs_db_del(db, (char *)ip_fixed, strlen(ip_fixed)+1) < 0) {
-		PBS_DEBUG("pbs_db_get");
+		VANESSA_LOGGER_DEBUG("pbs_db_get");
 		goto leave;
 	}
 
 	if(pbs_db_del(db, (char *)time_ip, strlen(time_ip)+1) < 0) {
-		PBS_DEBUG("pbs_db_get");
+		VANESSA_LOGGER_DEBUG("pbs_db_get");
 		goto leave;
 	}