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#include <stdexcept>
12#include <string>
13
14namespace ev::logger {
15
20inline void info(const char *message) {
21 std::cout << "INFO. openev: " << message << '\n';
22}
23
28inline void warning(const char *message, const bool assert_condition = false) {
29 if(assert_condition) {
30 return;
31 }
32 std::cout << "WARNING. openev: " << message << '\n';
33}
34
39inline void error(const char *message, const bool assert_condition = false) {
40 if(assert_condition) {
41 return;
42 }
43 throw std::runtime_error("ERROR. openev: " + std::string(message, std::allocator<char>()));
44}
45
46} // namespace ev::logger
47
48#endif // OPENEV_UTILS_LOGGER_HPP
void info(const char *message)
Log message at info level.
Definition logger.hpp:20
void error(const char *message, const bool assert_condition=false)
Log message at error level.
Definition logger.hpp:39
void warning(const char *message, const bool assert_condition=false)
Log message at warning level.
Definition logger.hpp:28