console_bridge_compat.h
Go to the documentation of this file.
1 
9 /*
10  * libmavconn
11  * Copyright 2018 Vladimir Ermakov, All rights reserved.
12  *
13  * This file is part of the mavros package and subject to the license terms
14  * in the top-level LICENSE file of the mavros repository.
15  * https://github.com/mavlink/mavros/tree/master/LICENSE.md
16  */
17 
18 #pragma once
19 
20 #include <console_bridge/console.h>
21 
22 // [[[cog:
23 // for idx, func in enumerate(('debug', 'inform', 'warn', 'error')):
24 // fn = f'CONSOLE_BRIDGE_log{func.title()}'
25 // fu = func.upper()
26 //
27 // if func == 'inform': # NOTE: special case
28 // fu = 'INFO'
29 //
30 // if idx != 0:
31 // cog.outl()
32 //
33 // cog.outl(f'#ifndef {fn}')
34 // cog.outl(f'#define {fn}(fmt, ...) \\')
35 // cog.outl(f'\tconsole_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_{fu}, fmt, ##__VA_ARGS__)')
36 // cog.outl(f'#endif // {fn}')
37 // ]]]
38 #ifndef CONSOLE_BRIDGE_logDebug
39 #define CONSOLE_BRIDGE_logDebug(fmt, ...) \
40  console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_DEBUG, fmt, ##__VA_ARGS__)
41 #endif // CONSOLE_BRIDGE_logDebug
42 
43 #ifndef CONSOLE_BRIDGE_logInform
44 #define CONSOLE_BRIDGE_logInform(fmt, ...) \
45  console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_INFO, fmt, ##__VA_ARGS__)
46 #endif // CONSOLE_BRIDGE_logInform
47 
48 #ifndef CONSOLE_BRIDGE_logWarn
49 #define CONSOLE_BRIDGE_logWarn(fmt, ...) \
50  console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_WARN, fmt, ##__VA_ARGS__)
51 #endif // CONSOLE_BRIDGE_logWarn
52 
53 #ifndef CONSOLE_BRIDGE_logError
54 #define CONSOLE_BRIDGE_logError(fmt, ...) \
55  console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_ERROR, fmt, ##__VA_ARGS__)
56 #endif // CONSOLE_BRIDGE_logError
57 // [[[end]]] (checksum: c8dda3189b05a621b7244bf375275345)


libmavconn
Author(s): Vladimir Ermakov
autogenerated on Mon Jul 8 2019 03:20:07