Anjay Lite
Loading...
Searching...
No Matches
log.h
Go to the documentation of this file.
1
/*
2
* Copyright 2023-2025 AVSystem <avsystem@avsystem.com>
3
* AVSystem Anjay Lite LwM2M SDK
4
* All rights reserved.
5
*
6
* Licensed under AVSystem Anjay Lite LwM2M Client SDK - Non-Commercial License.
7
* See the attached LICENSE file for details.
8
*/
9
10
#include <
anj/init.h
>
11
20
#ifndef ANJ_LOG_LOG_H
21
# define ANJ_LOG_LOG_H
22
23
# include <stdio.h>
24
25
# ifdef __cplusplus
26
extern
"C"
{
27
# endif
28
29
# include <
anj/compat/log_impl_decls.h
>
// IWYU pragma: export
30
# include <
anj/utils.h
>
31
33
# define ANJ_INTERNAL_INCLUDE_LOG_FILTERING_UTILS
34
# include <anj_internal/log/log_filtering_utils.h>
35
# undef ANJ_INTERNAL_INCLUDE_LOG_FILTERING_UTILS
46
# define ANJ_LOG_PRINTF_ARG_CHECK(...) ((void) sizeof(printf(__VA_ARGS__)))
47
52
# define ANJ_LOG_ENFORCE_FORMAT_INLINE_LITERAL(...) "" __VA_ARGS__
53
62
# define ANJ_LOG_COMPILE_TIME_CHECK(...) \
63
ANJ_LOG_PRINTF_ARG_CHECK( \
64
ANJ_LOG_ENFORCE_FORMAT_INLINE_LITERAL(__VA_ARGS__))
65
66
# ifdef _ANJ_LOG_ENABLED
67
68
# ifdef ANJ_LOG_FULL
69
# define ANJ_LOG_HANDLER_IMPL_MACRO(Module, LogLevel, ...) \
70
anj_log_handler_impl_full(ANJ_LOG_LEVEL_##LogLevel, \
71
ANJ_QUOTE_MACRO(Module), __FILE__, \
72
__LINE__, __VA_ARGS__)
73
# endif
// ANJ_LOG_FULL
74
75
# ifdef ANJ_LOG_ALT_IMPL_HEADER
76
# include ANJ_LOG_ALT_IMPL_HEADER
77
# endif
// ANJ_LOG_ALT_IMPL_HEADER
78
79
# ifdef ANJ_LOG_FILTERING_CONFIG_HEADER
80
# include ANJ_LOG_FILTERING_CONFIG_HEADER
81
# endif
// ANJ_LOG_FILTERING_CONFIG_HEADER
82
83
# ifndef ANJ_LOG_LEVEL_DEFAULT
84
# define ANJ_LOG_LEVEL_DEFAULT L_INFO
85
# endif
// ANJ_LOG_LEVEL_DEFAULT
86
87
# define ANJ_LOG_IF_ALLOWED_LOOKUP_ANJ_LOG_YES(Module, LogLevel, ...) \
88
ANJ_LOG_HANDLER_IMPL_MACRO(Module, LogLevel, __VA_ARGS__)
89
# define ANJ_LOG_IF_ALLOWED_LOOKUP_ANJ_LOG_NO(Module, LogLevel, ...) \
90
((void) 0)
91
92
# define ANJ_LOG_IF_ALLOWED(Module, LogLevel, ...) \
93
ANJ_CONCAT(ANJ_LOG_IF_ALLOWED_LOOKUP_, \
94
_ANJ_LOG_EMIT_CALL(LogLevel, \
95
_ANJ_LOG_MODULE_LEVEL(Module))) \
96
(Module, LogLevel, __VA_ARGS__)
97
# else
// _ANJ_LOG_ENABLED
98
# define ANJ_LOG_IF_ALLOWED(Module, LogLevel, ...) ((void) 0)
99
# endif
// _ANJ_LOG_ENABLED
120
# define anj_log(Module, LogLevel, ...) \
121
((void) (ANJ_LOG_IF_ALLOWED(Module, LogLevel, __VA_ARGS__), \
122
ANJ_LOG_COMPILE_TIME_CHECK(__VA_ARGS__)))
123
125
# ifdef ANJ_LOG_STRIP_CONSTANTS
126
# define ANJ_LOG_DISPOSABLE_IMPL(Arg) " "
127
# else
// ANJ_LOG_STRIP_CONSTANTS
128
# define ANJ_LOG_DISPOSABLE_IMPL(Arg) Arg
129
# endif
// ANJ_LOG_STRIP_CONSTANTS
145
# define ANJ_LOG_DISPOSABLE(Arg) ANJ_LOG_DISPOSABLE_IMPL(Arg)
146
147
# ifdef __cplusplus
148
}
149
# endif
150
151
#endif
// ANJ_LOG_LOG_H
init.h
Global configuration validation header for Anjay Lite.
log_impl_decls.h
Platform hooks for log output.
utils.h
Public utility helpers used throughout Anjay Lite.
include_public
anj
log.h
Generated on Tue Oct 21 2025 13:51:16 for Anjay Lite by
1.9.8