stumpless  2.1.0
err.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_ERR_H
28 # define __STUMPLESS_LEVEL_ERR_H
29 
30 # include <stumpless/level/mask.h>
31 
32 # ifndef STUMPLESS_DISABLE_ERR_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_ERR_LEVEL
98 # define stump_er( ... ) ( 0 )
99 # else
100 # define stump_er( ... ) \
101 stumpless_add_log( stumpless_get_current_target( ), \
102  STUMPLESS_SEVERITY_ERR | STUMPLESS_DEFAULT_FACILITY, \
103  __VA_ARGS__ )
104 # endif
105 
155 # ifdef STUMPLESS_DISABLE_ERR_LEVEL
156 # define stump_er_str( message ) ( 0 )
157 # else
158 # define stump_er_str( message ) \
159 stumpless_add_log_str( stumpless_get_current_target( ), \
160  STUMPLESS_SEVERITY_ERR | STUMPLESS_DEFAULT_FACILITY, \
161  ( message ) )
162 # endif
163 
208 # ifdef STUMPLESS_DISABLE_ERR_LEVEL
209 # define stump_er_entry( target, entry ) ( 0 )
210 # else
211 # define stump_er_entry( target, entry ) \
212 stumpless_add_entry( ( target ), ( entry ) )
213 # endif
214 
273 # ifdef STUMPLESS_DISABLE_ERR_LEVEL
274 # define stump_er_log( target, priority, ... ) ( 0 )
275 # else
276 # define stump_er_log( target, priority, ... ) \
277 stumpless_add_log( ( target ), ( priority ), __VA_ARGS__ )
278 #endif
279 
329 # ifdef STUMPLESS_DISABLE_ERR_LEVEL
330 # define stump_er_log_str( target, priority, message ) ( 0 )
331 # else
332 # define stump_er_log_str( target, priority, message ) \
333 stumpless_add_log_str( ( target ), ( priority ), ( message ) )
334 #endif
335 
396 # ifdef STUMPLESS_DISABLE_ERR_LEVEL
397 # define stump_er_message( target, ... ) ( 0 )
398 # else
399 # define stump_er_message( target, ... ) \
400 stumpless_add_log( ( target ), \
401  STUMPLESS_DEFAULT_FACILITY | STUMPLESS_SEVERITY_ERR, \
402  __VA_ARGS__ )
403 # endif
404 
456 # ifdef STUMPLESS_DISABLE_ERR_LEVEL
457 # define stump_er_message_str( target, message ) ( 0 )
458 # else
459 # define stump_er_message_str( target, message ) \
460 stumpless_add_log_str( ( target ), \
461  STUMPLESS_DEFAULT_FACILITY | STUMPLESS_SEVERITY_ERR, \
462  ( message ) )
463 # endif
464 
515 # ifdef STUMPLESS_DISABLE_ERR_LEVEL
516 # define stumplog_er( priority, ... ) ( ( void ) 0 )
517 # else
518 # define stumplog_er( priority, ... ) stumplog( ( priority ), __VA_ARGS__ )
519 # endif
520 
562 # ifdef STUMPLESS_DISABLE_ERR_LEVEL
563 # define stumplog_er_str( priority, message ) ( ( void ) 0 )
564 # else
565 # define stumplog_er_str( priority, message ) \
566 stumplog_str( ( priority ), ( message ) )
567 # endif
568 
569 #endif /* __STUMPLESS_LEVEL_ERR_H */
severity.h
mask.h
target.h
log.h
config.h