F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Fw::Logger Class Referenceabstract

#include <Fw/Logger/Logger.hpp>

Inheritance diagram for Fw::Logger:
Os::Console

Public Member Functions

virtual ~Logger ()=default
 Virtual destructor. More...
 

Static Public Member Functions

static void log (const char *format,...)
 log a formated string with supplied arguments More...
 
static void log (const Fw::StringBase &message)
 log a string message directly More...
 
static void registerLogger (Logger *logger)
 register a logger implementation More...
 

Protected Member Functions

virtual void writeMessage (const StringBase &message)=0
 write the output of the log message More...
 

Friends

struct LoggerRules::Register
 

Detailed Description

Definition at line 21 of file Logger.hpp.

Constructor & Destructor Documentation

◆ ~Logger()

virtual Fw::Logger::~Logger ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ log() [1/2]

void Fw::Logger::log ( const char *  format,
  ... 
)
static

log a formated string with supplied arguments

Logs a format string with the arguments filled-in. This delegates to StringBase.format, which in-turn delegates to snprintf. This implies that the caller is fully responsible for handling the type safety of the supplied format string. The format string uses C-style (printf function family) formatting.

Parameters
formatformat string
...var-args list of arguments to inject into format string.

Definition at line 21 of file Logger.cpp.

◆ log() [2/2]

void Fw::Logger::log ( const Fw::StringBase message)
static

log a string message directly

Logs the string directly to the backing store without any formatting changes.

Parameters
messagemessage to log

Definition at line 31 of file Logger.cpp.

◆ registerLogger()

void Fw::Logger::registerLogger ( Logger logger)
static

register a logger implementation

This registers the supplied logger as the system logger used for calls to Fw::Logger::log.

Parameters
loggerlogger to register as the system logger

Definition at line 37 of file Logger.cpp.

◆ writeMessage()

virtual void Fw::Logger::writeMessage ( const StringBase message)
protectedpure virtual

write the output of the log message

Log implementations must provide this method used to write the output of a string to the log backing.

Parameters
messagemessage to log

Implemented in Os::Console.

Friends And Related Function Documentation

◆ LoggerRules::Register

friend struct LoggerRules::Register
friend

Definition at line 22 of file Logger.hpp.


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