Imported Upstream version 3.2.0
[debian/amanda] / server-src / logfile.h
1 /*
2  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3  * Copyright (c) 1991-1998 University of Maryland at College Park
4  * All Rights Reserved.
5  *
6  * Permission to use, copy, modify, distribute, and sell this software and its
7  * documentation for any purpose is hereby granted without fee, provided that
8  * the above copyright notice appear in all copies and that both that
9  * copyright notice and this permission notice appear in supporting
10  * documentation, and that the name of U.M. not be used in advertising or
11  * publicity pertaining to distribution of the software without specific,
12  * written prior permission.  U.M. makes no representations about the
13  * suitability of this software for any purpose.  It is provided "as is"
14  * without express or implied warranty.
15  *
16  * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
18  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22  *
23  * Author: James da Silva, Systems Design and Analysis Group
24  *                         Computer Science Department
25  *                         University of Maryland at College Park
26  */
27 /*
28  * $Id: logfile.h,v 1.13 2006/05/25 01:47:20 johnfranks Exp $
29  *
30  * interface to logfile module
31  */
32 #ifndef LOGFILE_H
33 #define LOGFILE_H
34
35 #include "amanda.h"
36
37 /*
38  * L_FAIL is defined on m88k-motorola-sysv4 systems for multiprocessor
39  * support, which we don't need, so it gets undefined here.
40  */
41 #undef L_FAIL
42
43 typedef enum logtype_e {
44     L_BOGUS,
45     L_FATAL,            /* program died for some reason, used by error() */
46     L_ERROR, L_WARNING, L_INFO, L_SUMMARY,       /* information messages */
47     L_START, L_FINISH,                               /* start/end of run */
48     L_DISK,                                                      /* disk */
49     /* End of a dump: */
50     L_DONE, L_PART, L_PARTPARTIAL, L_SUCCESS, L_PARTIAL, L_FAIL, L_STRANGE,
51     L_CHUNK, L_CHUNKSUCCESS,                            /* ... continued */
52     L_STATS,                                               /* statistics */
53     L_MARKER,                                     /* marker for reporter */
54     L_CONT                       /* continuation line, used when reading */
55 } logtype_t;
56
57 typedef enum program_e {
58     P_UNKNOWN, P_PLANNER, P_DRIVER, P_REPORTER, P_DUMPER, P_CHUNKER,
59     P_TAPER, P_AMFLUSH, P_AMDUMP, P_AMIDXTAPED, P_AMFETCHDUMP, P_AMCHECKDUMP,
60     P_AMVAULT, P_SENTINEL
61 } program_t;
62 #define P_LAST (P_SENTINEL-1)
63
64 extern char *logtype_str[];
65
66 extern int curlinenum;
67 extern logtype_t curlog;
68 extern program_t curprog;
69 extern char *curstr;
70 extern char *program_str[];
71
72 void amanda_log_trace_log(GLogLevelFlags log_level, const gchar *message);
73 void log_add(logtype_t typ, char * format, ...) G_GNUC_PRINTF(2, 3);
74 void log_add_full(logtype_t typ, char *pname, char *format, ...) G_GNUC_PRINTF(3, 4);
75 void log_start_multiline(void);
76 void log_end_multiline(void);
77 void log_rename(char *datestamp);
78 int get_logline(FILE *);
79
80 #endif  /* ! LOGFILE_H */