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