LoboMQ
Loading...
Searching...
No Matches
Logger.cpp File Reference
#include "Logger.h"

Go to the source code of this file.

Functions

Elog * initializeSerialLogger (LoggerClass className, Loglevel level)
 Creates a logger that prints messages to the serial monitor.
 
Elog * initializeSDLogger (LoggerClass className, int cs, int sck, int miso, int mosi, Loglevel level)
 Creates a logger that prints messages to a file inside a SD card.
 
Elog * disableLogger ()
 Creates a logger without the ability to print messages.
 

Variables

SPIClass spi_logger = SPIClass(VSPI)
 

Detailed Description

Author
Rubén Gómez Villegas

This file contains the necessary logic to easily create an Elog logger object for LoboMQ.

Definition in file Logger.cpp.

Function Documentation

◆ disableLogger()

Elog * disableLogger ( )

Creates a logger without the ability to print messages.

This function creates a logger used by the broker or client which will not print any message produced by the library.

Returns
A pointer to an Elog instance set up to not log messages.

Definition at line 52 of file Logger.cpp.

◆ initializeSDLogger()

Elog * initializeSDLogger ( LoggerClass className,
int cs,
int sck,
int miso,
int mosi,
Loglevel level = DEFAULT_LOG_LEVEL )

Creates a logger that prints messages to a file inside a SD card.

This function creates a logger used by the broker or client which prints messages to a file in the SD card as most critical as the indicated.

Parameters
classNameThe log class.
csThe Chip Select pin of the SD card module.
sckThe Serial Clock pin of the SD card module.
misoThe Master In Slave Out pin of the SD card module.
mosiThe Master Out Slave In pin of the SD card module.
levelThe most critical level of registration in which there is interest.
Returns
A pointer to an Elog instance set up to log to the SD card.

Definition at line 34 of file Logger.cpp.

◆ initializeSerialLogger()

Elog * initializeSerialLogger ( LoggerClass className,
Loglevel level = DEFAULT_LOG_LEVEL )

Creates a logger that prints messages to the serial monitor.

This function creates a logger used by the broker or client which prints messages to the serial monitor as most critical as the indicated.

Parameters
classNameThe log class.
levelThe most critical level of registration in which there is interest.
Returns
A pointer to an Elog instance set up to log through the serial monitor.

Definition at line 13 of file Logger.cpp.

Variable Documentation

◆ spi_logger

SPIClass spi_logger = SPIClass(VSPI)

Definition at line 11 of file Logger.cpp.