Skip to content

Commit c7e0231

Browse files
dont rely on existence of short version of the macros, define the long with API calls instead (#66)
1 parent 9e30d57 commit c7e0231

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

include/class_loader/console_bridge_compatibility.h

+10-6
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,23 @@
3333
#include <console_bridge/console.h>
3434

3535
#ifndef CONSOLE_BRIDGE_logError
36-
#define CONSOLE_BRIDGE_logError logError
36+
# define CONSOLE_BRIDGE_logError(fmt, ...) \
37+
console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_ERROR, fmt, ##__VA_ARGS__)
3738
#endif
3839

3940
#ifndef CONSOLE_BRIDGE_logWarn
40-
#define CONSOLE_BRIDGE_logWarn logWarn
41+
# define CONSOLE_BRIDGE_logWarn(fmt, ...) \
42+
console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_WARN, fmt, ##__VA_ARGS__)
4143
#endif
4244

43-
#ifndef CONSOLE_BRIDGE_logDebug
44-
#define CONSOLE_BRIDGE_logDebug logDebug
45+
#ifndef CONSOLE_BRIDGE_logInform
46+
# define CONSOLE_BRIDGE_logInform(fmt, ...) \
47+
console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_INFO, fmt, ##__VA_ARGS__)
4548
#endif
4649

47-
#ifndef CONSOLE_BRIDGE_logInform
48-
#define CONSOLE_BRIDGE_logInform logInform
50+
#ifndef CONSOLE_BRIDGE_logDebug
51+
# define CONSOLE_BRIDGE_logDebug(fmt, ...) \
52+
console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_DEBUG, fmt, ##__VA_ARGS__)
4953
#endif
5054

5155
#endif // CLASS_LOADER__CONSOLE_BRIDGE_COMPATIBILITY_H_

0 commit comments

Comments
 (0)