mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 17:47:10 -06:00
* lestarch: adding logical types implementation into Linux/StandardTypes.hpp * lestarch: removing VxWorks StandardTypes from repository * updated fprime types for correct compilation with vxworks and baremetal * lestarch: refactoring types and configuration header w.r.t type design * lestarch: replacing usages of AssertArg with FwAssertArgType * lestarch: missspelled configuration * lestarch: minor compilation fixes * lestarch: renaming StandardTypes.hpp -> PlatformTypes.hpp * lestarch: updating PRI tokens * lestarch: replacing BasicTypes.hpp includes with FpConfig.hpp * lestarch: UT and compilation fixes for types refactor * lestarch: sp * lestarch: fixing RPI issues in PassiveConsoleTextLogger * lestarch: converting RPI build to debug * lestarch: removing duplicate config imports * lestarch: fixing documentation * lestarch: fixing up multiple definitions and RPI compilation problems * lestarch: reverting debug build * lestarch: reverting platform types to class-based constants * lestarch: reworking basic types * lestarch: configured types refactor into classes * lestarch: fixing bugs with static constants in classes * lestarch: fixing platform types spelling and documentation * lestarch: adding include guards to types headers Co-authored-by: Kevin F Ortega <kevin.f.ortega@jpl.nasa.gov>
91 lines
3.4 KiB
C++
91 lines
3.4 KiB
C++
/**
|
|
* File: Logger.hpp
|
|
* Description: Framework logging support
|
|
* Author: mstarch
|
|
*
|
|
* This file adds in support to the core 'Fw' package, to separate it from Os and other loggers, and
|
|
* allow the architect of the system to select which core framework logging should be used.
|
|
*/
|
|
#ifndef _Fw_Logger_hpp_
|
|
#define _Fw_Logger_hpp_
|
|
|
|
#include <FpConfig.hpp>
|
|
|
|
namespace Fw {
|
|
class Logger {
|
|
public:
|
|
/**
|
|
* Function called on the logger to log a message. This is abstract virtual method and
|
|
* must be supplied by the subclass. This logger object should be registered with the
|
|
* Fw::Log::registerLogger function.
|
|
* \param fmt: format string in which to place arguments
|
|
* \param a0: zeroth argument. (Default: 0)
|
|
* \param a1: first argument. (Default: 0)
|
|
* \param a2: second argument. (Default: 0)
|
|
* \param a3: third argument. (Default: 0)
|
|
* \param a4: fourth argument. (Default: 0)
|
|
* \param a5: fifth argument. (Default: 0)
|
|
* \param a6: sixth argument. (Default: 0)
|
|
* \param a7: seventh argument. (Default: 0)
|
|
* \param a8: eighth argument. (Default: 0)
|
|
* \param a9: ninth argument. (Default: 0)
|
|
*/
|
|
virtual void log(
|
|
const char* fmt,
|
|
POINTER_CAST a0 = 0,
|
|
POINTER_CAST a1 = 0,
|
|
POINTER_CAST a2 = 0,
|
|
POINTER_CAST a3 = 0,
|
|
POINTER_CAST a4 = 0,
|
|
POINTER_CAST a5 = 0,
|
|
POINTER_CAST a6 = 0,
|
|
POINTER_CAST a7 = 0,
|
|
POINTER_CAST a8 = 0,
|
|
POINTER_CAST a9 = 0
|
|
) = 0;
|
|
|
|
/**
|
|
* Logs a message using the currently specified static logger. If a logger is not
|
|
* registered, then the log message is dropped.
|
|
* \param fmt: format string in which to place arguments
|
|
* \param a0: zeroth argument. (Default: 0)
|
|
* \param a1: first argument. (Default: 0)
|
|
* \param a2: second argument. (Default: 0)
|
|
* \param a3: third argument. (Default: 0)
|
|
* \param a4: fourth argument. (Default: 0)
|
|
* \param a5: fifth argument. (Default: 0)
|
|
* \param a6: sixth argument. (Default: 0)
|
|
* \param a7: seventh argument. (Default: 0)
|
|
* \param a8: eighth argument. (Default: 0)
|
|
* \param a9: ninth argument. (Default: 0)
|
|
*/
|
|
static void logMsg(
|
|
const char* fmt,
|
|
POINTER_CAST a0 = 0,
|
|
POINTER_CAST a1 = 0,
|
|
POINTER_CAST a2 = 0,
|
|
POINTER_CAST a3 = 0,
|
|
POINTER_CAST a4 = 0,
|
|
POINTER_CAST a5 = 0,
|
|
POINTER_CAST a6 = 0,
|
|
POINTER_CAST a7 = 0,
|
|
POINTER_CAST a8 = 0,
|
|
POINTER_CAST a9 = 0
|
|
);
|
|
|
|
/**
|
|
* Registers the static logger for use with the Fw::Log::logMsg function. This must be
|
|
* a subclass of Fw::Log.
|
|
* \param logger: logger to log to when Fw::Log::logMsg is called.
|
|
*/
|
|
static void registerLogger(Logger* logger);
|
|
|
|
//!< Static logger to use when calling the above 'logMsg' function
|
|
static Logger* s_current_logger;
|
|
|
|
virtual ~Logger();
|
|
};
|
|
}
|
|
|
|
#endif
|