include
socketcan_interface
logging.h
Go to the documentation of this file.
1
#ifndef SOCKETCAN_INTERFACE_LOGGING_H
2
#define SOCKETCAN_INTERFACE_LOGGING_H
3
4
#include <console_bridge/console.h>
5
#include <sstream>
6
7
#define ROSCANOPEN_LOG(name, file, line, level, args) { std::stringstream sstr; sstr << name << ": " << args; console_bridge::getOutputHandler()->log(sstr.str(), level, file, line); }
8
9
#define ROSCANOPEN_ERROR(name, args) ROSCANOPEN_LOG(name, __FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_ERROR, args)
10
#define ROSCANOPEN_INFO(name, args) ROSCANOPEN_LOG(name, __FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_INFO, args)
11
#define ROSCANOPEN_WARN(name, args) ROSCANOPEN_LOG(name, __FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_WARN, args)
12
#define ROSCANOPEN_DEBUG(name, args) ROSCANOPEN_LOG(name, __FILE__, __LINE__,console_bridge::CONSOLE_BRIDGE_LOG_DEBUG, args)
13
14
// extra function to mark it as deprecated
15
inline
__attribute__
((deprecated(
"please use ROSCANOPEN_* macros"
))) void roscanopen_log_deprecated(const std::
string
s, const
char
* f,
int
l) { console_bridge::getOutputHandler()->log(s, console_bridge::CONSOLE_BRIDGE_LOG_ERROR, f, l); }
16
#define LOG(args) { std::stringstream sstr; sstr << "LOG: " << args; roscanopen_log_deprecated(sstr.str(), __FILE__, __LINE__); }
17
#endif
__attribute__
__attribute__((deprecated("please use ROSCANOPEN_* macros"))) void roscanopen_log_deprecated(const std
Definition:
logging.h:15
socketcan_interface
Author(s): Mathias Lüdtke
autogenerated on Wed Mar 2 2022 00:52:25