log.c 603 Bytes
Newer Older
Per Cederqvist's avatar
Per Cederqvist committed
1
2
3
4
5
6
/*
 * log.c
 *
 * File created by ceder 1990-05-25.
 */

Per Cederqvist's avatar
Per Cederqvist committed
7
8
9
static char *rcsid = "$Id: log.c,v 0.2 1991/08/28 02:21:27 ceder Exp $";


Per Cederqvist's avatar
Per Cederqvist committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "log.h"

/*
 * Add a string to the log file.
 */

extern void
log (const char * format, ...)
{
    va_list AP;

    va_start(AP, format);
    logv(format, AP);
    va_end(AP);
}


extern void
logv (const char *format, va_list AP)
{
    time_t clock;

    
    time(&clock);

    fprintf(stderr, "--LOGG-> %s: ", ctime(&clock));
    vfprintf(stderr, format, AP);

    fflush(stderr);
}