Debug class that allows a finer control over serial debug.
More...
#include <Debug.h>
|
| SerialDebug (HardwareSerial *serial=&Serial) |
|
void | print (String st, Levels level) |
| Sends a string to the Serial port with a debug level, only if it is lower than the setted one.
|
|
void | println (String st, Levels level) |
| Sends a line to the serial port with a debug level, only if it is lower than the setted one.
|
|
void | print (String st) |
| Sends a debug string to the serial port, only debug is accepted.
|
|
void | println (String st) |
| Sends a debug line to the serial port, only debug is accepted.
|
|
template<class T > |
void | print (T any, Levels level) |
|
template<class T > |
void | println (T any, Levels level) |
|
template<class T > |
void | print (T any) |
|
template<class T > |
void | println (T any) |
|
void | delayd (int t) |
| Delay used only in debug.
|
|
void | setLevel (Levels lvl) |
| Sets the level to be used for the debug.
|
|
void | setSerial (HardwareSerial *serial) |
|
Debug class that allows a finer control over serial debug.
Any message can have a level given by the Levels enum. Only messages with level lower than the one set by using setLevel(Levels lvl) are printed. The level is also written before the message in the serial output so even when all levels are being printed it's easy to distinguish and eventually remove unnecessary output.
◆ SerialDebug()
SerialDebug::SerialDebug |
( |
HardwareSerial * |
serial = &Serial | ) |
|
|
inline |
◆ delayd()
void SerialDebug::delayd |
( |
int |
t | ) |
|
Delay used only in debug.
This should be used to avoid errors while running in competition.
- Parameters
-
t | Time to wait in microseconds. |
◆ print() [1/4]
void SerialDebug::print |
( |
String |
st | ) |
|
Sends a debug string to the serial port, only debug is accepted.
The debug level will be sent only if it's a new line.
- Parameters
-
◆ print() [2/4]
void SerialDebug::print |
( |
String |
st, |
|
|
Levels |
level |
|
) |
| |
Sends a string to the Serial port with a debug level, only if it is lower than the setted one.
The debug level will be sent only if it's a new line.
- Parameters
-
st | String to print. |
level | Debug level. |
◆ print() [3/4]
template<class T >
void SerialDebug::print |
( |
T |
any | ) |
|
|
inline |
◆ print() [4/4]
template<class T >
void SerialDebug::print |
( |
T |
any, |
|
|
Levels |
level |
|
) |
| |
|
inline |
◆ println() [1/4]
void SerialDebug::println |
( |
String |
st | ) |
|
Sends a debug line to the serial port, only debug is accepted.
The debug level will be sent only if it's a new line.
- Parameters
-
◆ println() [2/4]
void SerialDebug::println |
( |
String |
st, |
|
|
Levels |
level |
|
) |
| |
Sends a line to the serial port with a debug level, only if it is lower than the setted one.
The debug level will be sent only if it's a new line.
- Parameters
-
st | String to print. |
level | Debug level. |
◆ println() [3/4]
template<class T >
void SerialDebug::println |
( |
T |
any | ) |
|
|
inline |
◆ println() [4/4]
template<class T >
void SerialDebug::println |
( |
T |
any, |
|
|
Levels |
level |
|
) |
| |
|
inline |
◆ setLevel()
void SerialDebug::setLevel |
( |
Levels |
level | ) |
|
Sets the level to be used for the debug.
- Parameters
-
◆ setSerial()
void SerialDebug::setSerial |
( |
HardwareSerial * |
serial | ) |
|
The documentation for this class was generated from the following files: