summaryrefslogtreecommitdiff
path: root/include/logreport.h
blob: 1909964bf77111f8e29b5ac0ab7b8f34481f3575 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* logreport.h: status reporting routines.

Copyright (C) 1992 Free Software Foundation, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */

#ifndef LOGREPORT_H
#define LOGREPORT_H

#include <stdio.h>
#include <kpathsea/types.h>


/* report.h is a separate file because the programs which use it are a
   proper subset of the programs which use us.  */
#include "report.h"


/* The file we write information to.  */
extern FILE *log_file;

/* Only write if this is true.  */
extern boolean logging;

#define LOG(s)								\
  do { if (logging) fputs (s, log_file); } while (0)
#define LOG1(s, e)							\
  do { if (logging) fprintf (log_file, s, e); } while (0)
#define LOG2(s, e1, e2)							\
  do { if (logging) fprintf (log_file, s, e1, e2); } while (0)
#define LOG3(s, e1, e2, e3)						\
  do { if (logging) fprintf (log_file, s, e1, e2, e3); } while (0)
#define LOG4(s, e1, e2, e3, e4)						\
  do { if (logging) fprintf (log_file, s, e1, e2, e3, e4); } while (0)
#define LOG5(s, e1, e2, e3, e4, e5)					\
  do { if (logging) fprintf (log_file, s, e1, e2, e3, e4, e5); } while (0)

extern void flush_log_output (void);

#endif /* not LOGREPORT_H */