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