Dawn Framework
1.0
Universal data acquisition framework for embedded systems
dawn
include
dawn
debug.hxx
1
// dawn/include/dawn/debug.hxx
2
//
3
// SPDX-License-Identifier: Apache-2.0
4
//
5
6
#pragma once
7
8
#include <cassert>
9
#include <syslog.h>
10
11
#include "dawn/porting/config.hxx"
12
13
// Info messages
14
15
#ifdef CONFIG_DAWN_DEBUG_INFO
16
# define DAWNINFO(format, ...) \
17
syslog(LOG_MAKEPRI(LOG_USER, LOG_INFO), "dawn: " format, ##__VA_ARGS__)
18
#else
19
# define DAWNINFO(format, ...)
20
#endif
21
22
// Warning messages
23
24
#ifdef CONFIG_DAWN_DEBUG_WARN
25
# define DAWNWARN(format, ...) \
26
syslog(LOG_MAKEPRI(LOG_USER, LOG_WARNING), "dawn: " format, ##__VA_ARGS__)
27
#else
28
# define DAWNWARN(format, ...)
29
#endif
30
31
// Error messages
32
33
#ifdef CONFIG_DAWN_DEBUG_ERROR
34
# define DAWNERR(format, ...) \
35
syslog(LOG_MAKEPRI(LOG_USER, LOG_ERR), "dawn: " format, ##__VA_ARGS__)
36
#else
37
# define DAWNERR(format, ...)
38
#endif
39
40
// Custom Dawn assertions.
41
//
42
// Input parameters:
43
// a - assertion condition to check
44
// msg - additional message about what is wrong
45
46
#define DAWNASSERT(a, msg) assert(a)
Generated by
1.9.8