stumpless 2.2.0
Loading...
Searching...
No Matches
emerg.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: Apache-2.0 */
2
3/*
4 * Copyright 2021-2024 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
28#ifndef __STUMPLESS_LEVEL_EMERG_H
29#define __STUMPLESS_LEVEL_EMERG_H
30
32
33#ifndef STUMPLESS_DISABLE_EMERG_LEVEL
34# include <stumpless/config.h>
35# include <stumpless/log.h>
36# include <stumpless/severity.h>
37# include <stumpless/target.h>
38#endif
39
94#ifdef STUMPLESS_DISABLE_EMERG_LEVEL
95# define stump_em( ... ) ( 0 )
96#else
97# define stump_em( ... ) \
98stumpless_add_log( stumpless_get_current_target(), \
99 STUMPLESS_SEVERITY_EMERG | \
100 STUMPLESS_DEFAULT_FACILITY, \
101 __VA_ARGS__ )
102#endif
103
153#ifdef STUMPLESS_DISABLE_EMERG_LEVEL
154# define stump_em_str( message ) ( 0 )
155#else
156# define stump_em_str( message ) \
157stumpless_add_log_str( stumpless_get_current_target( ), \
158 STUMPLESS_SEVERITY_EMERG | \
159 STUMPLESS_DEFAULT_FACILITY, \
160 ( message ) )
161#endif
162
207#ifdef STUMPLESS_DISABLE_EMERG_LEVEL
208# define stump_em_entry( target, entry ) ( 0 )
209#else
210# define stump_em_entry( target, entry ) \
211stumpless_add_entry( ( target ), ( entry ) )
212#endif
213
268#ifdef STUMPLESS_DISABLE_EMERG_LEVEL
269# define stump_em_log( target, priority, ... ) ( 0 )
270#else
271# define stump_em_log( target, priority, ... ) \
272stumpless_add_log( ( target ), ( priority ), __VA_ARGS__ )
273#endif
274
325#ifdef STUMPLESS_DISABLE_EMERG_LEVEL
326# define stump_em_log_str( target, priority, message ) ( 0 )
327#else
328# define stump_em_log_str( target, priority, message ) \
329stumpless_add_log_str( ( target ), ( priority ), ( message ) )
330#endif
331
388#ifdef STUMPLESS_DISABLE_EMERG_LEVEL
389# define stump_em_message( target, ... ) ( 0 )
390#else
391# define stump_em_message( target, ... ) \
392stumpless_add_log( ( target ), \
393 STUMPLESS_DEFAULT_FACILITY | \
394 STUMPLESS_SEVERITY_EMERG, \
395 __VA_ARGS__ )
396#endif
397
449#ifdef STUMPLESS_DISABLE_EMERG_LEVEL
450# define stump_em_message_str( target, message ) ( 0 )
451#else
452# define stump_em_message_str( target, message ) \
453stumpless_add_log_str( ( target ), \
454 STUMPLESS_DEFAULT_FACILITY | \
455 STUMPLESS_SEVERITY_EMERG, \
456 ( message ) )
457#endif
458
505#ifdef STUMPLESS_DISABLE_EMERG_LEVEL
506# define stumplog_em( priority, ... ) ( ( void ) 0 )
507#else
508# define stumplog_em( priority, ... ) \
509stumplog( ( priority ), __VA_ARGS__ )
510#endif
511
553#ifdef STUMPLESS_DISABLE_EMERG_LEVEL
554# define stumplog_em_str( priority, message ) ( ( void ) 0 )
555#else
556# define stumplog_em_str( priority, message ) \
557stumplog_str( ( priority ), ( message ) )
558#endif
559
560#endif /* __STUMPLESS_LEVEL_EMERG_H */
Convenience functions for creating and writing simple log entries.
Masks that provide shorthand for enabling or disabling logging levels at compile time.
Severity codes for classifying log entries.
General types and functions for working with all targets.