File: dummylog.c

package info (click to toggle)
autopartkit 1.07
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,060 kB
  • ctags: 198
  • sloc: ansic: 2,489; sh: 843; makefile: 103
file content (30 lines) | stat: -rw-r--r-- 512 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include "autopartkit.h"

void
autopartkit_error(int fatal, const char * format, ...)
{
    va_list ap;

    va_start(ap, format);
    fprintf(stderr, "error: ");
    vfprintf(stderr, format, ap);
    va_end(ap);
    if (fatal)
      exit(fatal);
}

void
autopartkit_log(const int level, const char * format, ...)
{
    va_list ap;

    fprintf(stderr, "log %d: ", level);

    va_start(ap, format);
    vfprintf(stderr, format, ap);
    va_end(ap);
}