/**
* Print a message to stderr and log it via syslog. The message must be
* less than BUFSIZ characters long, or it will be truncated.
/**
* Print a message to stderr and log it via syslog. The message must be
* less than BUFSIZ characters long, or it will be truncated.
If level is higher (less urgent) than the program's verbosity (see options.h) no message will be printed
* @param funct - String indicating the function name from which this function was called.
If this is NULL, Log will show the unspecified_funct string instead
If level is higher (less urgent) than the program's verbosity (see options.h) no message will be printed
* @param funct - String indicating the function name from which this function was called.
If this is NULL, Log will show the unspecified_funct string instead
-void LogEx(int level, const char * funct, ...)
+void LogEx(int level, const char * funct, const char * file, int line, ...)
fmt = va_arg(va, const char*);
if (fmt == NULL) // sanity check
fmt = va_arg(va, const char*);
if (fmt == NULL) // sanity check
- syslog(level, "%s: %s - %s", severity, funct, buffer);
+ syslog(level, "%s: %s (%s:%d) - %s", severity, funct, file, line, buffer);
}
/**
* Handle a Fatal error in the program by printing a message and exiting the program
* CALLING THIS FUNCTION WILL CAUSE THE PROGAM TO EXIT
* @param funct - Name of the calling function
}
/**
* Handle a Fatal error in the program by printing a message and exiting the program
* CALLING THIS FUNCTION WILL CAUSE THE PROGAM TO EXIT
* @param funct - Name of the calling function
- syslog(LOG_CRIT, "FATAL: %s - %s", funct, buffer);
+ syslog(LOG_CRIT, "FATAL: %s (%s:%d) - %s", funct, file, line, buffer);
+