RF24Log  0.1.3
Unified logging library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ArduinoPrintLogger Class Reference

A log handler implementation which outputs log messages to a stream. More...

#include <ArduinoPrintLogger.h>

Inheritance diagram for ArduinoPrintLogger:
RF24LogPrintfParser RF24LogAbstractHandler RF24LogAbstractStream RF24LogBaseHandler

Public Member Functions

 ArduinoPrintLogger (Print *stream)
 instance constructor More...
 
- Public Member Functions inherited from RF24LogAbstractHandler
 RF24LogAbstractHandler ()
 Sets log level to INFO upon instantiation.
 
void log (uint8_t logLevel, const char *vendorId, const char *message, va_list *args)
 log a message. More...
 
void setLogLevel (uint8_t logLevel)
 

Protected Member Functions

void appendTimestamp ()
 output a timestamp
 
void appendChar (char data, uint16_t depth=1)
 append a character a number of times More...
 
void appendInt (long data)
 append a signed (+/-) number More...
 
void appendUInt (unsigned long data, uint8_t base=10)
 append an ‘unsigned’ (only +) number More...
 
void appendDouble (double data, uint8_t precision=2)
 append a floating point number More...
 
void appendStr (const char *data)
 append a c-string More...
 
- Protected Member Functions inherited from RF24LogPrintfParser
void write (uint8_t logLevel, const char *vendorId, const char *message, va_list *args)
 
- Protected Member Functions inherited from RF24LogAbstractStream
void appendLogLevel (uint8_t logLevel)
 output a description of the log level More...
 
void descTimeLevel (uint8_t logLevel)
 Automate the output of the header' timestamp and level description. More...
 
void appendFormat (FormatSpecifier *fmt_parser, va_list *args)
 output a data according to the format specifier More...
 

Protected Attributes

Print * _stream
 The output stream.
 
- Protected Attributes inherited from RF24LogAbstractHandler
uint8_t _logLevel
 

Detailed Description

A log handler implementation which outputs log messages to a stream.

Examples
AllLogLevels.ino, DualStream.ino, and gettingStarted.ino.

Definition at line 24 of file ArduinoPrintLogger.h.

Constructor & Destructor Documentation

◆ ArduinoPrintLogger()

ArduinoPrintLogger::ArduinoPrintLogger ( Print *  stream)

instance constructor

Parameters
streamThe output stream to which logging messages are directed.

Definition at line 21 of file ArduinoPrintLogger.cpp.

Member Function Documentation

◆ appendChar()

void ArduinoPrintLogger::appendChar ( char  data,
uint16_t  depth = 1 
)
protectedvirtual

append a character a number of times

Parameters
dataThe char to use
depthThe number of times that the data is sequentially output.

Implements RF24LogAbstractStream.

Definition at line 39 of file ArduinoPrintLogger.cpp.

◆ appendDouble()

void ArduinoPrintLogger::appendDouble ( double  data,
uint8_t  precision = 2 
)
protectedvirtual

append a floating point number

Parameters
dataThe numeric data
precisionThe number of decimals places to output

Implements RF24LogAbstractStream.

Definition at line 64 of file ArduinoPrintLogger.cpp.

◆ appendInt()

void ArduinoPrintLogger::appendInt ( long  data)
protectedvirtual

append a signed (+/-) number

Parameters
dataThe numeric data

Implements RF24LogAbstractStream.

Definition at line 50 of file ArduinoPrintLogger.cpp.

◆ appendStr()

void ArduinoPrintLogger::appendStr ( const char *  data)
protectedvirtual

append a c-string

Parameters
dataThe c-string data

Implements RF24LogAbstractStream.

Definition at line 71 of file ArduinoPrintLogger.cpp.

◆ appendUInt()

void ArduinoPrintLogger::appendUInt ( unsigned long  data,
uint8_t  base = 10 
)
protectedvirtual

append an ‘unsigned’ (only +) number

Parameters
dataThe numeric data
baseThe base counting scheme. Defaults to 10 for decimal counting system

Implements RF24LogAbstractStream.

Definition at line 57 of file ArduinoPrintLogger.cpp.


The documentation for this class was generated from the following files: