#include <Logger.h>
|
| Logger (const Logger &obj)=delete |
|
void | setSDManager (SDManager *manager) |
|
void | setHypnos (Loom_Hypnos *hypnos) |
|
void | debugLog (const char *message, bool silent, const char *file, const char *func, unsigned long lineNumber) |
|
void | errorLog (const char *message, bool silent, const char *file, const char *func, unsigned long lineNumber) |
|
void | warningLog (const char *message, bool silent, const char *file, const char *func, unsigned long lineNumber) |
|
void | debugLog (const __FlashStringHelper *message, bool silent, const char *file, const char *func, unsigned long lineNumber) |
|
void | warningLog (const __FlashStringHelper *message, bool silent, const char *file, const char *func, unsigned long lineNumber) |
|
void | errorLog (const __FlashStringHelper *message, bool silent, const char *file, const char *func, unsigned long lineNumber) |
|
void | genericLog (const char *level, const char *message, bool silent, const char *file, const char *func, unsigned long lineNumber) |
|
void | logLong (char *message, bool silent) |
|
void | startFunction (const char *file, const char *func, unsigned long num, int freeMemory) |
|
void | endFunction (int freeMemory) |
|
void | enableSummaries () |
|
void | enableSD () |
|
|
static Logger * | getInstance () |
|
Arduino Logger class that allows for standardized log outputs as well as function memory usage summaries to find memory leaks that may lead to unexpected crashing
- Author
- Will Richards
◆ debugLog() [1/2]
void Logger::debugLog |
( |
const __FlashStringHelper * |
message, |
|
|
bool |
silent, |
|
|
const char * |
file, |
|
|
const char * |
func, |
|
|
unsigned long |
lineNumber |
|
) |
| |
|
inline |
Logs a Debug Message to the SD card and the serial monitor
- Parameters
-
message | Message to log |
silent | If set to silent it will not appear in the serial monitor |
lineNumber | The current line number this log is on |
◆ debugLog() [2/2]
void Logger::debugLog |
( |
const char * |
message, |
|
|
bool |
silent, |
|
|
const char * |
file, |
|
|
const char * |
func, |
|
|
unsigned long |
lineNumber |
|
) |
| |
|
inline |
Logs a Debug Message to the SD card and the serial monitor
- Parameters
-
message | Message to log |
silent | If set to silent it will not appear in the serial monitor |
lineNumber | The current line number this log is on |
◆ endFunction()
void Logger::endFunction |
( |
int |
freeMemory | ) |
|
|
inline |
Marks the end of a function, logs summary to SD card
- Parameters
-
ret | Openly typed variable to show the return type of the function |
◆ errorLog() [1/2]
void Logger::errorLog |
( |
const __FlashStringHelper * |
message, |
|
|
bool |
silent, |
|
|
const char * |
file, |
|
|
const char * |
func, |
|
|
unsigned long |
lineNumber |
|
) |
| |
|
inline |
Logs an Error Message to the SD card and the serial monitor
- Parameters
-
message | Message to log |
silent | If set to silent it will not appear in the serial monitor |
lineNumber | The current line number this log is on |
◆ errorLog() [2/2]
void Logger::errorLog |
( |
const char * |
message, |
|
|
bool |
silent, |
|
|
const char * |
file, |
|
|
const char * |
func, |
|
|
unsigned long |
lineNumber |
|
) |
| |
|
inline |
Logs an Error Message to the SD card and the serial monitor
- Parameters
-
message | Message to log |
silent | If set to silent it will not appear in the serial monitor |
lineNumber | The current line number this log is on |
◆ genericLog()
void Logger::genericLog |
( |
const char * |
level, |
|
|
const char * |
message, |
|
|
bool |
silent, |
|
|
const char * |
file, |
|
|
const char * |
func, |
|
|
unsigned long |
lineNumber |
|
) |
| |
|
inline |
Generic logging function to cut down on redundant code in each log function
- Parameters
-
level | Strings representing different log levels eg. DEBUG, WARNING, ERROR |
message | The actual message we want to log |
silent | Whether or not we want to actually print the data to the Serial monitor or just log it to the SD card |
file | Name of the file in which the log was called |
func | Name of the function in which the log was called |
lineNumber | The line number that the log was called on |
◆ setHypnos()
Set the instance of the Hypnos, this should be used if you want the current timestamp added to the front of the logger output
- Parameters
-
hypnos | Pointer to the hypnos object this also sets the sdInst |
◆ setSDManager()
void Logger::setSDManager |
( |
SDManager * |
manager | ) |
|
|
inline |
Set the instance of the SD Manager
- Parameters
-
manager | Pointer to the SD manager to allow us to utilize SD logging functionality |
◆ startFunction()
void Logger::startFunction |
( |
const char * |
file, |
|
|
const char * |
func, |
|
|
unsigned long |
num, |
|
|
int |
freeMemory |
|
) |
| |
|
inline |
Marks the start of a new function
- Parameters
-
file | File name that the function is in |
func | Function name that this call is in |
num | Current line number in the file of which this call is located |
◆ warningLog() [1/2]
void Logger::warningLog |
( |
const __FlashStringHelper * |
message, |
|
|
bool |
silent, |
|
|
const char * |
file, |
|
|
const char * |
func, |
|
|
unsigned long |
lineNumber |
|
) |
| |
|
inline |
Logs a Warning Message to the SD card and the serial monitor
- Parameters
-
message | Message to log |
silent | If set to silent it will not appear in the serial monitor |
lineNumber | The current line number this log is on |
◆ warningLog() [2/2]
void Logger::warningLog |
( |
const char * |
message, |
|
|
bool |
silent, |
|
|
const char * |
file, |
|
|
const char * |
func, |
|
|
unsigned long |
lineNumber |
|
) |
| |
|
inline |
Logs a Warning Message to the SD card and the serial monitor
- Parameters
-
message | Message to log |
silent | If set to silent it will not appear in the serial monitor |
lineNumber | The current line number this log is on |
The documentation for this class was generated from the following files:
- C:/Users/jwilt/AppData/Local/Arduino15/packages/loom4/hardware/samd/4.5/libraries/Loom/src/Logger.h
- C:/Users/jwilt/AppData/Local/Arduino15/packages/loom4/hardware/samd/4.5/libraries/Loom/src/Loom_Manager.cpp