17c478bdstevel@tonic-gate /*
27c478bdstevel@tonic-gate  * This module intercepts syslog() library calls and redirects their output
37c478bdstevel@tonic-gate  * to the standard output stream. For interactive testing.
47c478bdstevel@tonic-gate  *
57c478bdstevel@tonic-gate  * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
67c478bdstevel@tonic-gate  */
77c478bdstevel@tonic-gate
87c478bdstevel@tonic-gate#ifndef lint
97c478bdstevel@tonic-gatestatic char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17:42:21";
107c478bdstevel@tonic-gate#endif
117c478bdstevel@tonic-gate
127c478bdstevel@tonic-gate#include <stdio.h>
137c478bdstevel@tonic-gate
147c478bdstevel@tonic-gate#include "mystdarg.h"
157c478bdstevel@tonic-gate
167c478bdstevel@tonic-gate/* openlog - dummy */
177c478bdstevel@tonic-gate
187c478bdstevel@tonic-gate/* ARGSUSED */
199455584Igor Kozhukhovvoid
207c478bdstevel@tonic-gateopenlog(name, logopt, facility)
217c478bdstevel@tonic-gatechar   *name;
227c478bdstevel@tonic-gateint     logopt;
237c478bdstevel@tonic-gateint     facility;
247c478bdstevel@tonic-gate{
257c478bdstevel@tonic-gate    /* void */
267c478bdstevel@tonic-gate}
277c478bdstevel@tonic-gate
287c478bdstevel@tonic-gate/* vsyslog - format one record */
299455584Igor Kozhukhovvoid
307c478bdstevel@tonic-gatevsyslog(severity, fmt, ap)
317c478bdstevel@tonic-gateint     severity;
327c478bdstevel@tonic-gatechar   *fmt;
337c478bdstevel@tonic-gateva_list ap;
347c478bdstevel@tonic-gate{
357c478bdstevel@tonic-gate    char    buf[BUFSIZ];
367c478bdstevel@tonic-gate
377c478bdstevel@tonic-gate    vprintf(percent_m(buf, fmt), ap);
387c478bdstevel@tonic-gate    printf("\n");
397c478bdstevel@tonic-gate    fflush(stdout);
407c478bdstevel@tonic-gate}
417c478bdstevel@tonic-gate
427c478bdstevel@tonic-gate/* syslog - format one record */
437c478bdstevel@tonic-gate
447c478bdstevel@tonic-gate/* VARARGS */
459455584Igor Kozhukhovvoid
467c478bdstevel@tonic-gateVARARGS(syslog, int, severity)
477c478bdstevel@tonic-gate{
487c478bdstevel@tonic-gate    va_list ap;
497c478bdstevel@tonic-gate    char   *fmt;
507c478bdstevel@tonic-gate
517c478bdstevel@tonic-gate    VASTART(ap, int, severity);
527c478bdstevel@tonic-gate    fmt = va_arg(ap, char *);
537c478bdstevel@tonic-gate    vsyslog(severity, fmt, ap);
547c478bdstevel@tonic-gate    VAEND(ap);
557c478bdstevel@tonic-gate}
567c478bdstevel@tonic-gate
577c478bdstevel@tonic-gate/* closelog - dummy */
589455584Igor Kozhukhovvoid
597c478bdstevel@tonic-gatecloselog()
607c478bdstevel@tonic-gate{
617c478bdstevel@tonic-gate    /* void */
627c478bdstevel@tonic-gate}
63