stumpless  2.1.0
alert.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0 */
2 
3 /*
4  * Copyright 2020-2022 Joel E. Anderson
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
27 #ifndef __STUMPLESS_LEVEL_ALERT_H
28 # define __STUMPLESS_LEVEL_ALERT_H
29 
30 # include <stumpless/level/mask.h>
31 
32 # ifndef STUMPLESS_DISABLE_ALERT_LEVEL
33 # include <stumpless/config.h>
34 # include <stumpless/log.h>
35 # include <stumpless/severity.h>
36 # include <stumpless/target.h>
37 # endif
38 
97 # ifdef STUMPLESS_DISABLE_ALERT_LEVEL
98 # define stump_a( ... ) ( 0 )
99 # else
100 # define stump_a( ... ) \
101 stumpless_add_log( stumpless_get_current_target( ), \
102  STUMPLESS_SEVERITY_ALERT | STUMPLESS_DEFAULT_FACILITY, \
103  __VA_ARGS__ )
104 # endif
105 
153 # ifdef STUMPLESS_DISABLE_ALERT_LEVEL
154 # define stump_a_str( message ) ( 0 )
155 # else
156 # define stump_a_str( message ) \
157 stumpless_add_log_str( stumpless_get_current_target( ), \
158  STUMPLESS_SEVERITY_ALERT | STUMPLESS_DEFAULT_FACILITY, \
159  ( message ) )
160 # endif
161 
206 # ifdef STUMPLESS_DISABLE_ALERT_LEVEL
207 # define stump_a_entry( target, entry ) ( 0 )
208 # else
209 # define stump_a_entry( target, entry ) \
210 stumpless_add_entry( ( target ), ( entry ) )
211 # endif
212 
271 # ifdef STUMPLESS_DISABLE_ALERT_LEVEL
272 # define stump_a_log( target, priority, ... ) ( 0 )
273 # else
274 # define stump_a_log( target, priority, ... ) \
275 stumpless_add_log( ( target ), ( priority ), __VA_ARGS__ )
276 #endif
277 
327 # ifdef STUMPLESS_DISABLE_ALERT_LEVEL
328 # define stump_a_log_str( target, priority, message ) ( 0 )
329 # else
330 # define stump_a_log_str( target, priority, message ) \
331 stumpless_add_log_str( ( target ), ( priority ), ( message ) )
332 #endif
333 
394 # ifdef STUMPLESS_DISABLE_ALERT_LEVEL
395 # define stump_a_message( target, ... ) ( 0 )
396 # else
397 # define stump_a_message( target, ... ) \
398 stumpless_add_log( ( target ), \
399  STUMPLESS_DEFAULT_FACILITY | STUMPLESS_SEVERITY_ALERT, \
400  __VA_ARGS__ )
401 # endif
402 
454 # ifdef STUMPLESS_DISABLE_ALERT_LEVEL
455 # define stump_a_message_str( target, message ) ( 0 )
456 # else
457 # define stump_a_message_str( target, message ) \
458 stumpless_add_log_str( ( target ), \
459  STUMPLESS_DEFAULT_FACILITY | STUMPLESS_SEVERITY_ALERT, \
460  ( message ) )
461 # endif
462 
513 # ifdef STUMPLESS_DISABLE_ALERT_LEVEL
514 # define stumplog_a( priority, ... ) ( ( void ) 0 )
515 # else
516 # define stumplog_a( priority, ... ) stumplog( ( priority ), __VA_ARGS__ )
517 # endif
518 
560 # ifdef STUMPLESS_DISABLE_ALERT_LEVEL
561 # define stumplog_a_str( priority, message ) ( ( void ) 0 )
562 # else
563 # define stumplog_a_str( priority, message ) \
564 stumplog_str( ( priority ), ( message ) )
565 # endif
566 
567 #endif /* __STUMPLESS_LEVEL_ALERT_H */
severity.h
mask.h
target.h
log.h
config.h