error: Use macros for error functions.

This commit is contained in:
Andreas Schneider
2011-09-17 10:28:39 +02:00
parent afa56e0102
commit c19c638d74
8 changed files with 137 additions and 105 deletions

View File

@@ -136,16 +136,20 @@ void ssh_log_function(ssh_session session,
* @param verbosity The verbosity of the event.
* @param format The format string of the log entry.
*/
void ssh_log_common(struct ssh_common_struct *common, int verbosity, const char *format, ...){
char buffer[1024];
va_list va;
void ssh_log_common(struct ssh_common_struct *common,
int verbosity,
const char *function,
const char *format, ...)
{
char buffer[1024];
va_list va;
if (verbosity <= common->log_verbosity) {
va_start(va, format);
vsnprintf(buffer, sizeof(buffer), format, va);
va_end(va);
do_ssh_log(common, verbosity, "common", buffer);
}
if (verbosity <= common->log_verbosity) {
va_start(va, format);
vsnprintf(buffer, sizeof(buffer), format, va);
va_end(va);
do_ssh_log(common, verbosity, function, buffer);
}
}
/** @} */