RBControl
Library for the RB3201-RBControl board with the ESP32 by RoboticsBrno.
RBControl_logger.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
4 #include <string>
5 
6 #include "logger/format.hpp"
7 #include "logger/logging.hpp"
8 
12 namespace rb {
13 extern Logger logger;
14 
15 template <typename... Args>
16 FormatString log(int verbosity, const std::string& tag, const std::string& message, Args... args) {
17  return rb::logger.log(verbosity, tag, message, std::forward<Args>(args)...);
18 }
19 
20 template <typename... Args>
21 FormatString logPanic(const std::string& tag, const std::string& message, Args... args) {
22  return rb::logger.logPanic(tag, message, std::forward<Args>(args)...);
23 }
24 
25 template <typename... Args>
26 FormatString logError(const std::string& tag, const std::string& message, Args... args) {
27  return rb::logger.logError(tag, message, std::forward<Args>(args)...);
28 }
29 
30 template <typename... Args>
31 FormatString logWarning(const std::string& tag, const std::string& message, Args... args) {
32  return rb::logger.logWarning(tag, message, std::forward<Args>(args)...);
33 }
34 
35 template <typename... Args>
36 FormatString logInfo(const std::string& tag, const std::string& message, Args... args) {
37  return rb::logger.logInfo(tag, message, std::forward<Args>(args)...);
38 }
39 
40 template <typename... Args>
41 FormatString logDebug(const std::string& tag, const std::string& message, Args... args) {
42  return rb::logger.logDebug(tag, message, std::forward<Args>(args)...);
43 }
44 
45 } // namespace rb
The base namespace. Contains some logging functions, too.
Definition: half_duplex_uart.cpp:53
FormatString logPanic(const std::string &tag, const std::string &message, Args... args)
Definition: RBControl_logger.hpp:21
FormatString logInfo(const std::string &tag, const std::string &message, Args... args)
Definition: RBControl_logger.hpp:36
FormatString log(int verbosity, const std::string &tag, const std::string &message, Args... args)
Definition: RBControl_logger.hpp:16
Logger logger
Definition: RBControl_logger.cpp:5
FormatString logWarning(const std::string &tag, const std::string &message, Args... args)
Definition: RBControl_logger.hpp:31
FormatString logDebug(const std::string &tag, const std::string &message, Args... args)
Definition: RBControl_logger.hpp:41
FormatString logError(const std::string &tag, const std::string &message, Args... args)
Definition: RBControl_logger.hpp:26