1/* 2 * Copyright (c) 1989 Regents of the University of California. 3 * All rights reserved. The Berkeley software License Agreement 4 * specifies the terms and conditions for redistribution. 5 */ 6 7#include <popper.h> 8RCSID("$Id$"); 9 10/* 11 * log: Make a log entry 12 */ 13 14int 15pop_log(POP *p, int stat, char *format, ...) 16{ 17 char msgbuf[MAXLINELEN]; 18 va_list ap; 19 20 va_start(ap, format); 21 vsnprintf(msgbuf, sizeof(msgbuf), format, ap); 22 23 if (p->debug && p->trace) { 24 fprintf(p->trace,"%s\n",msgbuf); 25 fflush(p->trace); 26 } else { 27#ifdef KRB5 28 krb5_log(p->context, p->logf, stat, "%s", msgbuf); 29#else 30 syslog (stat,"%s",msgbuf); 31#endif 32 } 33 va_end(ap); 34 35 return(stat); 36} 37