USRP Hardware Driver and USRP Manual
Version: 4.1.0.3
UHD and USRP Manual
log.h
Go to the documentation of this file.
1
/*
2
* Copyright 2017 Ettus Research (National Instruments Corp.)
3
*
4
* SPDX-License-Identifier: GPL-3.0-or-later
5
*/
6
7
#pragma once
8
9
#include <
uhd/config.h
>
10
11
typedef
enum
{
12
UHD_LOG_LEVEL_TRACE
,
13
UHD_LOG_LEVEL_DEBUG
,
14
UHD_LOG_LEVEL_INFO
,
15
UHD_LOG_LEVEL_WARNING
,
16
UHD_LOG_LEVEL_ERROR
,
17
UHD_LOG_LEVEL_FATAL
18
}
uhd_log_severity_level_t
;
19
20
#ifdef __cplusplus
21
extern
"C"
{
22
#endif
23
24
void
UHD_API
_uhd_log
(
25
const
uhd_log_severity_level_t
log_level,
26
const
char
*filename,
27
const
int
lineno,
28
const
char
*comp,
29
const
char
*format,
30
...
31
);
32
33
#ifdef __cplusplus
34
};
35
#endif
36
37
38
#ifndef __cplusplus
39
// macro-style logging (compile-time determined)
40
#if UHD_LOG_MIN_LEVEL < 1
41
#define UHD_LOG_TRACE(component, ...) \
42
_uhd_log(UHD_LOG_LEVEL_TRACE, __FILE__, __LINE__, component, __VA_ARGS__);
43
#else
44
#define UHD_LOG_TRACE(component, ...)
45
#endif
46
47
#if UHD_LOG_MIN_LEVEL < 2
48
#define UHD_LOG_DEBUG(component, ...) \
49
_uhd_log(UHD_LOG_LEVEL_DEBUG, __FILE__, __LINE__, component, __VA_ARGS__);
50
#else
51
#define UHD_LOG_DEBUG(component, ...)
52
#endif
53
54
#if UHD_LOG_MIN_LEVEL < 3
55
#define UHD_LOG_INFO(component, ...) \
56
_uhd_log(UHD_LOG_LEVEL_INFO, __FILE__, __LINE__, component, __VA_ARGS__);
57
#else
58
#define UHD_LOG_INFO(component, ...)
59
#endif
60
61
#if UHD_LOG_MIN_LEVEL < 4
62
#define UHD_LOG_WARNING(component, ...) \
63
_uhd_log(UHD_LOG_LEVEL_WARNING, __FILE__, __LINE__, component, __VA_ARGS__);
64
#else
65
#define UHD_LOG_WARNING(component, ...)
66
#endif
67
68
#if UHD_LOG_MIN_LEVEL < 5
69
#define UHD_LOG_ERROR(component, ...) \
70
_uhd_log(UHD_LOG_LEVEL_ERROR, __FILE__, __LINE__, component, __VA_ARGS__);
71
#else
72
#define UHD_LOG_ERROR(component, ...)
73
#endif
74
75
#if UHD_LOG_MIN_LEVEL < 6
76
#define UHD_LOG_FATAL(component, ...) \
77
_uhd_log(UHD_LOG_LEVEL_FATAL, __FILE__, __LINE__, component, __VA_ARGS__);
78
#else
79
#define UHD_LOG_FATAL(component, ...)
80
#endif
81
82
#endif
/* #ifndef __cplusplus */
config.h
UHD_API
#define UHD_API
Definition:
config.h:70
uhd_log_severity_level_t
uhd_log_severity_level_t
Definition:
log.h:11
UHD_LOG_LEVEL_TRACE
@ UHD_LOG_LEVEL_TRACE
Definition:
log.h:12
UHD_LOG_LEVEL_ERROR
@ UHD_LOG_LEVEL_ERROR
Definition:
log.h:16
UHD_LOG_LEVEL_INFO
@ UHD_LOG_LEVEL_INFO
Definition:
log.h:14
UHD_LOG_LEVEL_DEBUG
@ UHD_LOG_LEVEL_DEBUG
Definition:
log.h:13
UHD_LOG_LEVEL_FATAL
@ UHD_LOG_LEVEL_FATAL
Definition:
log.h:17
UHD_LOG_LEVEL_WARNING
@ UHD_LOG_LEVEL_WARNING
Definition:
log.h:15
_uhd_log
void UHD_API _uhd_log(const uhd_log_severity_level_t log_level, const char *filename, const int lineno, const char *comp, const char *format,...)
include
uhd
utils
log.h
Generated by
1.9.3