tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
Loading...
Searching...
No Matches
error_handler.h
Go to the documentation of this file.
1#pragma once
3
4enum class ErrorLevel
5{
6 Plain,
7 Info,
9 Error,
10 Fatal
11};
12
13template <typename Impl>
15{
16public:
17 template <typename T>
18 static void log(const T &msg, ErrorLevel level = ErrorLevel::Plain)
19 {
20 Impl::log(msg, level);
21 }
22
23 template <typename... Args>
24 static void log(ErrorLevel level, Args &&...args)
25 {
26 Impl::log(level, forward<Args>(args)...);
27 }
28
29 template <typename T>
30 [[noreturn]] static void error(const T &msg)
31 {
32 Impl::error(msg);
33 }
34
35 template <typename... Args>
36 requires(sizeof...(Args) > 1)
37 [[noreturn]] static void error(Args &&...args)
38 {
39 Impl::error(forward<Args>(args)...);
40 }
41};
Definition error_handler.h:15
static void log(const T &msg, ErrorLevel level=ErrorLevel::Plain)
Definition error_handler.h:18
static void error(Args &&...args)
Definition error_handler.h:37
static void error(const T &msg)
Definition error_handler.h:30
static void log(ErrorLevel level, Args &&...args)
Definition error_handler.h:24
ErrorLevel
Definition error_handler.h:5