2 * Define Message Types for Bacula
6 Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of
11 the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public
19 License along with this program; if not, write to the Free
20 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
36 #define M_DEBUG 1 /* debug message */
37 #define M_ABORT 2 /* MUST abort immediately */
38 #define M_FATAL 3 /* Fatal error, stopping job */
39 #define M_ERROR 4 /* Error, but recoverable */
40 #define M_WARNING 5 /* Warning message */
41 #define M_INFO 6 /* Informational message */
42 #define M_SAVED 7 /* Info on saved file */
43 #define M_NOTSAVED 8 /* Info on notsaved file */
44 #define M_SKIPPED 9 /* File skipped by option setting */
45 #define M_MOUNT 10 /* Mount requests */
46 #define M_TERM 11 /* Termination request */
48 #define M_MAX M_TERM /* keep this updated ! */
50 /* Define message destination structure */
51 /* *** FIXME **** where should be extended to handle multiple values */
52 typedef struct s_dest {
54 int dest_code; /* destination (one of the MD_ codes) */
55 int max_len; /* max mail line length */
56 FILE *fd; /* file descriptor */
57 char msg_types[nbytes_for_bits(M_MAX+1)]; /* message type mask */
58 char *where; /* filename/program name */
59 char *mail_cmd; /* mail command */
60 char *mail_filename; /* unique mail filename */
63 /* Message Destination values for dest field of DEST */
64 #define MD_SYSLOG 1 /* send msg to syslog */
65 #define MD_MAIL 2 /* email group of messages */
66 #define MD_FILE 3 /* write messages to a file */
67 #define MD_APPEND 4 /* append messages to a file */
68 #define MD_STDOUT 5 /* print messages */
69 #define MD_STDERR 6 /* print messages to stderr */
70 #define MD_DIRECTOR 7 /* send message to the Director */
71 #define MD_OPERATOR 8 /* email a single message to the operator */
72 #define MD_CONSOLE 9 /* send msg to UserAgent or console */
73 #define MD_MAIL_ON_ERROR 10 /* email messages if job errors */
76 void d_msg(char *file, int line, int level, char *fmt,...);
77 void e_msg(char *file, int line, int type, int level, char *fmt,...);
78 void Jmsg(void *vjcr, int type, int level, char *fmt,...);
80 extern int debug_level;
81 extern char my_name[];
82 extern char *working_directory;
83 extern time_t daemon_start_time;