1 /*
2    BAREOS® - Backup Archiving REcovery Open Sourced
3 
4    Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
5    Copyright (C) 2011-2012 Planets Communications B.V.
6    Copyright (C) 2019-2019 Bareos GmbH & Co. KG
7 
8    This program is Free Software; you can redistribute it and/or
9    modify it under the terms of version three of the GNU Affero General Public
10    License as published by the Free Software Foundation and included
11    in the file LICENSE.
12 
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16    Affero General Public License for more details.
17 
18    You should have received a copy of the GNU Affero General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22 */
23 
24 #ifndef BAREOS_LIB_MESSAGE_LEVEL_H_
25 #define BAREOS_LIB_MESSAGE_LEVEL_H_
26 
27 #undef M_DEBUG
28 #undef M_ABORT
29 #undef M_FATAL
30 #undef M_ERROR
31 #undef M_WARNING
32 #undef M_INFO
33 #undef M_MOUNT
34 #undef M_ERROR_TERM
35 #undef M_TERM
36 #undef M_RESTORED
37 #undef M_SECURITY
38 #undef M_ALERT
39 #undef M_VOLMGMT
40 #undef M_AUDIT
41 
42 /**
43  * Most of these message levels are more or less obvious.
44  * They have evolved somewhat during the development of BAREOS,
45  * and here are some of the details of where I am trying to
46  * head (in the process of changing the code) as of 15 June 2002.
47  *
48  * M_ABORT       BAREOS immediately aborts and tries to produce a traceback
49  *               This is for really serious errors like segmentation fault.
50  * M_ERROR_TERM  BAREOS immediately terminates but no dump. This is for
51  *               "obvious" serious errors like daemon already running or
52  *               cannot open critical file, ... where a dump is not wanted.
53  * M_TERM        BAREOS daemon shutting down because of request (SIGTERM).
54  * M_DEBUG       Debug Messages
55  *
56  * The remaining apply to Jobs rather than the daemon.
57  *
58  * M_FATAL       BAREOS detected a fatal Job error. The Job will be killed,
59  *               but BAREOS continues running.
60  * M_ERROR       BAREOS detected a Job error. The Job will continue running
61  *               but the termination status will be error.
62  * M_WARNING     Job warning message.
63  * M_INFO        Job information message.
64  * M_SAVED       Info on saved file
65  * M_NOTSAVED    Info on not saved file
66  * M_RESTORED    An ls -l of each restored file.
67  * M_SKIPPED     File skipped during backup by option setting
68  * M_SECURITY    For security viloations. This is equivalent to FATAL.
69  * M_ALERT       For Tape Alert messages.
70  * M_VOLMGMT     Volume Management message
71  * M_AUDIT       Auditing message
72  * M_MOUNT       Mount requests
73  */
74 enum
75 {
76   /*
77    * Keep M_ABORT=1 for dlist.h
78    */
79   M_ABORT = 1,
80   M_DEBUG,
81   M_FATAL,
82   M_ERROR,
83   M_WARNING,
84   M_INFO,
85   M_SAVED,
86   M_NOTSAVED,
87   M_SKIPPED,
88   M_MOUNT,
89   M_ERROR_TERM,
90   M_TERM,
91   M_RESTORED,
92   M_SECURITY,
93   M_ALERT,
94   M_VOLMGMT,
95   M_AUDIT
96 };
97 
98 #define M_MAX M_AUDIT /* keep this updated ! */
99 #define NR_MSG_TYPES NbytesForBits(M_MAX + 1)
100 
101 #endif  // BAREOS_LIB_MESSAGE_LEVEL_H_
102