OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
logger.hpp
Go to the documentation of this file.
1
6#ifndef OPENEV_UTILS_LOGGER_HPP
7#define OPENEV_UTILS_LOGGER_HPP
8
9#include <iostream>
10#include <memory>
11
12namespace ev::logger {
13
18inline void info(const char *message) {
19 std::cout << "INFO. openev: " << message << '\n';
20}
21
26inline void warning(const char *message, const bool assert_condition = false) {
27 if(assert_condition) {
28 return;
29 }
30 std::cout << "WARNING. openev: " << message << '\n';
31}
32
37inline void error(const char *message, const bool assert_condition = false) {
38 if(assert_condition) {
39 return;
40 }
41 throw std::runtime_error("ERROR. openev: " + std::string(message, std::allocator<char>()));
42}
43
44} // namespace ev::logger
45
46#endif // OPENEV_UTILS_LOGGER_HPP
void info(const char *message)
Log message at info level.
Definition logger.hpp:18
void error(const char *message, const bool assert_condition=false)
Log message at error level.
Definition logger.hpp:37
void warning(const char *message, const bool assert_condition=false)
Log message at warning level.
Definition logger.hpp:26