fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
1/*****************************************************************************
2 * pce *
3 *****************************************************************************/
4
5/*****************************************************************************
6 * File name: src/lib/log.h *
7 * Created: 2003-02-02 by Hampa Hug <hampa@hampa.ch> *
8 * Copyright: (C) 2003-2022 Hampa Hug <hampa@hampa.ch> *
9 *****************************************************************************/
10
11/*****************************************************************************
12 * This program is free software. You can redistribute it and / or modify it *
13 * under the terms of the GNU General Public License version 2 as published *
14 * by the Free Software Foundation. *
15 * *
16 * This program is distributed in the hope that it will be useful, but *
17 * WITHOUT ANY WARRANTY, without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
19 * Public License for more details. *
20 *****************************************************************************/
21
22
23#ifndef PCE_LIB_LOG_H
24#define PCE_LIB_LOG_H 1
25
26
27#include <stdarg.h>
28#include <stdio.h>
29
30
31#define PCE_LOG_MAX 16
32
33#define MSG_ERR 0
34#define MSG_INF 1
35#define MSG_DEB 2
36
37
38void pce_log_init (void);
39void pce_log_done (void);
40
41int pce_log_add_fp (FILE *fp, int close, unsigned level);
42int pce_log_add_fname (const char *fname, unsigned level);
43void pce_log_rmv_fp (FILE *fp);
44
45void pce_log_set_level (FILE *fp, unsigned level);
46unsigned pce_log_get_level (FILE *fp);
47
48void pce_log (unsigned level, const char *msg, ...);
49void pce_log_va (unsigned level, const char *msg, va_list va);
50
51void pce_log_deb (const char *msg, ...);
52void pce_log_inf (const char *msg, ...);
53void pce_log_err (const char *msg, ...);
54
55void pce_log_tag (unsigned level, const char *tag, const char *msg, ...);
56
57
58#endif