GM6000 Digital Heater Controller Build: 16 (Branch = develop)
SDX-1330
List of all members | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
Cpl::Logging::TShell::Log Class Reference

This class implements a TShell command that operates on the persistently store "log file". More...

Detailed Description

This class implements a TShell command that operates on the persistently store "log file".

The implementation ASSUMES that the log entries are stored using the Cpl::Persistent framework.

Note: The command/TShell is blocked during access to the persistent media.

#include <Log.h>

Inheritance diagram for Cpl::Logging::TShell::Log:
[legend]
Collaboration diagram for Cpl::Logging::TShell::Log:
[legend]

Public Member Functions

const char * getUsage () const noexcept
 See Cpl::TShell::Command `.
 
const char * getHelp () const noexcept
 See Cpl::TShell::Command.
 
 Log (Cpl::Container::SList< Cpl::TShell::Command > &commandList, Cpl::Itc::PostApi &logEntryServerMailbox, Cpl::Persistent::IndexedEntryServer< Cpl::Logging::EntryData_T > &logEntryServer, Cpl::TShell::Security::Permission_T minPermLevel=OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL) noexcept
 Constructor.
 
Cpl::TShell::Command::Result_T execute (Cpl::TShell::Context_ &context, char *cmdString, Cpl::Io::Output &outfd) noexcept
 See Cpl::TShell::Command.
 
- Public Member Functions inherited from Cpl::TShell::Cmd::Command
const char * getVerb () const noexcept
 See Cpl::TShell::Command.
 
Security::Permission_T getMinPermissionRequired () const noexcept
 See Cpl::TShell::Command.
 
- Public Member Functions inherited from Cpl::TShell::Command
virtual ~Command ()
 Virtual destructor.
 
- Public Member Functions inherited from Cpl::Container::Item
bool insert_ (void *newContainerPtr)
 Helper method to trap when inserting an item in multiple containers.
 
bool isInContainer_ (const void *containerPtr) const noexcept
 Returns 'true' if the instance is in the specified container.
 

Static Public Attributes

static constexpr const char * verb = "log"
 The command verb/identifier.
 
static constexpr const char * usage
 The command usage string.
 
static constexpr const char * detailedHelp
 The command detailed help string (recommended that lines do not exceed 80 chars) 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890.
 

Protected Member Functions

bool getEntries (Cpl::TShell::Context_ &context, Cpl::Text::String &outtext, unsigned startIndex=0, unsigned maxEntries=0xFFFF) noexcept
 Helper method.
 
bool getLatestLogEntry (Cpl::Persistent::GetLatestRequest::Payload &payload) noexcept
 Helper method.
 
bool getPreviousLogEntry (Cpl::Persistent::GetPreviousRequest::Payload &payload) noexcept
 Helper method.
 
- Protected Member Functions inherited from Cpl::TShell::Cmd::Command
 Command (Cpl::Container::SList< Cpl::TShell::Command > &commandList, const char *verb, Security::Permission_T minPermLevel=OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL) noexcept
 Constructor.
 
- Protected Member Functions inherited from Cpl::TShell::Command
 Command ()
 Constructor.
 
- Protected Member Functions inherited from Cpl::Container::Item
 Item ()
 Constructor.
 
 Item (const char *)
 Constructor used ONLY with the child class MapItem: -->special constructor to allow a Map to be statically allocated.
 

Protected Attributes

Cpl::Itc::PostApim_logServerMailbox
 Mailbox of the thread that that the Log Server executes in.
 
Cpl::Persistent::IndexedEntryServer< Cpl::Logging::EntryData_T > & m_logServer
 Log Entry Server.
 
- Protected Attributes inherited from Cpl::TShell::Cmd::Command
const char * m_verb
 Command verb.
 
Security::Permission_T m_minPermissionLevel
 Minimum required user permission need to execute me.
 

Additional Inherited Members

- Public Types inherited from Cpl::TShell::Command
enum  Result_T {
  eSUCCESS = 0 , eERROR_BAD_SYNTAX = 1 , eERROR_INVALID_CMD = 2 , eERROR_IO = 3 ,
  eERROR_MISSING_ARGS = 4 , eERROR_EXTRA_ARGS = 5 , eERROR_INVALID_ARGS = 6 , eERROR_FAILED = 7
}
 Possible result codes when executing a command. More...
 
- Static Public Member Functions inherited from Cpl::Container::Item
static void remove_ (Item *itemPtr) noexcept
 Helper method to do the proper 'clean-up' for the multiple-containers-error-trap when removing an item from a container.
 
- Public Attributes inherited from Cpl::Container::Item
voidm_nextPtr_
 The link field.
 
voidm_inListPtr_
 Debug field.
 
- Protected Types inherited from Cpl::TShell::Cmd::Command
enum  CondResult_T { eFALSE , eTRUE , eERROR }
 Result when processing a conditional statement. More...
 

Constructor & Destructor Documentation

◆ Log()

Constructor.

Member Function Documentation

◆ execute()

Cpl::TShell::Command::Result_T Cpl::Logging::TShell::Log::execute ( Cpl::TShell::Context_ & context,
char * cmdString,
Cpl::Io::Output & outfd )
virtualnoexcept

◆ getEntries()

bool Cpl::Logging::TShell::Log::getEntries ( Cpl::TShell::Context_ & context,
Cpl::Text::String & outtext,
unsigned startIndex = 0,
unsigned maxEntries = 0xFFFF )
protectednoexcept

Helper method.

◆ getHelp()

const char * Cpl::Logging::TShell::Log::getHelp ( ) const
inlinevirtualnoexcept

◆ getLatestLogEntry()

bool Cpl::Logging::TShell::Log::getLatestLogEntry ( Cpl::Persistent::GetLatestRequest::Payload & payload)
protectednoexcept

Helper method.

◆ getPreviousLogEntry()

bool Cpl::Logging::TShell::Log::getPreviousLogEntry ( Cpl::Persistent::GetPreviousRequest::Payload & payload)
protectednoexcept

Helper method.

◆ getUsage()

const char * Cpl::Logging::TShell::Log::getUsage ( ) const
inlinevirtualnoexcept

Member Data Documentation

◆ detailedHelp

constexpr const char* Cpl::Logging::TShell::Log::detailedHelp
staticconstexpr
Initial value:
= " Displays and clear stored log records entries. Records are always displayed\n"
" newest entry first. The output format is:\n"
" \"[<entrykey>] (<entryTimestamp>) <CATID>:<MSGID>. <text>\"\n"
" - 'log' with no arguments displays the newest entry.\n"
" - 'log *' displays all entries.\n"
" - 'log <max>' displays at most <max> entries.\n"
" - 'log <nth> *' displays all log entries starting with the <nth> record."
" - 'log <nth> <max>' displays up to <max> entries starting with <nth> record."

The command detailed help string (recommended that lines do not exceed 80 chars) 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890.

◆ m_logServer

Cpl::Persistent::IndexedEntryServer<Cpl::Logging::EntryData_T>& Cpl::Logging::TShell::Log::m_logServer
protected

Log Entry Server.

◆ m_logServerMailbox

Cpl::Itc::PostApi& Cpl::Logging::TShell::Log::m_logServerMailbox
protected

Mailbox of the thread that that the Log Server executes in.

◆ usage

constexpr const char* Cpl::Logging::TShell::Log::usage
staticconstexpr
Initial value:
= "log [*|<max>]\n"
"log <nth> (*|<max>)\n"
"log clear\n"

The command usage string.

◆ verb

constexpr const char* Cpl::Logging::TShell::Log::verb = "log"
staticconstexpr

The command verb/identifier.


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