stumpless 2.2.0
Loading...
Searching...
No Matches
trace.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 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
32#ifndef __STUMPLESS_LEVEL_TRACE_H
33#define __STUMPLESS_LEVEL_TRACE_H
34
36
37#ifndef STUMPLESS_DISABLE_TRACE_LEVEL
38# include <stumpless/config.h>
39# include <stumpless/log.h>
40# include <stumpless/severity.h>
41# include <stumpless/target.h>
42#endif
43
103#ifdef STUMPLESS_DISABLE_TRACE_LEVEL
104# define stump_t( ... ) ( 0 )
105#else
106# define stump_t( ... ) \
107stumpless_trace_log( stumpless_get_current_target( ), \
108 STUMPLESS_SEVERITY_DEBUG | STUMPLESS_DEFAULT_FACILITY, \
109 __FILE__, \
110 __LINE__, \
111 __func__, \
112 __VA_ARGS__ )
113#endif
114
169#ifdef STUMPLESS_DISABLE_TRACE_LEVEL
170# define stump_t_str( message ) ( 0 )
171#else
172# define stump_t_str( message ) \
173stumpless_trace_log_str( stumpless_get_current_target( ), \
174 STUMPLESS_SEVERITY_DEBUG | STUMPLESS_DEFAULT_FACILITY,\
175 __FILE__, \
176 __LINE__, \
177 __func__, \
178 ( message ) )
179#endif
180
230#ifdef STUMPLESS_DISABLE_TRACE_LEVEL
231# define stump_t_entry( target, entry ) ( 0 )
232#else
233# define stump_t_entry( target, entry ) \
234stumpless_trace_entry( ( target ), ( entry ), __FILE__, __LINE__, __func__ )
235#endif
236
296#ifdef STUMPLESS_DISABLE_TRACE_LEVEL
297# define stump_t_log( target, priority, ... ) ( 0 )
298#else
299# define stump_t_log( target, priority, ... ) \
300stumpless_trace_log( ( target ), \
301 ( priority ), \
302 __FILE__, \
303 __LINE__, \
304 __func__, \
305 __VA_ARGS__ )
306#endif
307
363#ifdef STUMPLESS_DISABLE_TRACE_LEVEL
364# define stump_t_log_str( target, priority, message ) ( 0 )
365#else
366# define stump_t_log_str( target, priority, message ) \
367stumpless_trace_log_str( ( target ), \
368 ( priority ), \
369 __FILE__, \
370 __LINE__, \
371 __func__, \
372 ( message ) )
373#endif
374
436#ifdef STUMPLESS_DISABLE_TRACE_LEVEL
437# define stump_t_message( target, ... ) ( 0 )
438#else
439# define stump_t_message( target, ... ) \
440stumpless_trace_log( ( target ), \
441 STUMPLESS_DEFAULT_FACILITY | STUMPLESS_SEVERITY_DEBUG, \
442 __FILE__, \
443 __LINE__, \
444 __func__, \
445 __VA_ARGS__ )
446#endif
447
504#ifdef STUMPLESS_DISABLE_TRACE_LEVEL
505# define stump_t_message_str( target, message ) ( 0 )
506#else
507# define stump_t_message_str( target, message ) \
508stumpless_trace_log_str( ( target ), \
509 STUMPLESS_DEFAULT_FACILITY | STUMPLESS_SEVERITY_DEBUG,\
510 __FILE__, \
511 __LINE__, \
512 __func__, \
513 ( message ) )
514#endif
515
567#ifdef STUMPLESS_DISABLE_TRACE_LEVEL
568# define stumplog_t( priority, ... ) ( ( void ) 0 )
569#else
570# define stumplog_t( priority, ... ) \
571stumplog_trace( ( priority ), __FILE__, __LINE__, __func__, __VA_ARGS__ )
572#endif
573
620#ifdef STUMPLESS_DISABLE_TRACE_LEVEL
621# define stumplog_t_str( priority, message ) ( ( void ) 0 )
622#else
623# define stumplog_t_str( priority, message ) \
624stumplog_trace_str( ( priority ), __FILE__, __LINE__, __func__, ( message ) )
625#endif
626
627#endif /* __STUMPLESS_LEVEL_TRACE_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.