1#ifndef Cpl_Logging_TShell_Log_h 
    2#define Cpl_Logging_TShell_Log_h 
   15#include "colony_config.h" 
   39    static constexpr const char* 
verb = 
"log";
 
   42    static constexpr const char* 
usage = 
"log [*|<max>]\n" 
   43                                         "log <nth> (*|<max>)\n" 
   50        static constexpr const char* 
detailedHelp = 
"  Displays and clear stored log records entries. Records are always displayed\n" 
   51                                                    "  newest entry first.  The output format is:\n" 
   52                                                    "  \"[<entrykey>] (<entryTimestamp>) <CATID>:<MSGID>. <text>\"\n" 
   53                                                    "  - 'log' with no arguments displays the newest entry.\n" 
   54                                                    "  - 'log *' displays all entries.\n" 
   55                                                    "  - 'log <max>' displays at most <max> entries.\n" 
   56                                                    "  - 'log <nth> *' displays all log entries starting with the <nth> record." 
   57                                                    "  - 'log <nth> <max>' displays up to <max> entries starting with <nth> record.";
 
#define OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL
Default Permission level for all commands.
Definition Command.h:22
 
This template class implements a THREAD SAFE Ring Buffer.
Definition RingBufferMT.h:33
 
This partially abstract class defines a interface for operating on an output stream (example of a str...
Definition Output.h:34
 
This abstract class represents the interface used to send messages to a mailbox.
Definition PostApi.h:31
 
Defines the content of the Log entry.
Definition EntryData_T.h:56
 
This class implements a TShell command that operates on the persistently store "log file".
Definition Log.h:36
 
bool getEntries(Cpl::TShell::Context_ &context, Cpl::Text::String &outtext, unsigned startIndex=0, unsigned maxEntries=0xFFFF) noexcept
Helper method.
 
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 1234...
Definition Log.h:50
 
static constexpr const char * usage
The command usage string.
Definition Log.h:42
 
bool getLatestLogEntry(Cpl::Persistent::GetLatestRequest::Payload &payload) noexcept
Helper method.
 
Cpl::Itc::PostApi & m_logServerMailbox
Mailbox of the thread that that the Log Server executes in.
Definition Log.h:92
 
static constexpr const char * verb
The command verb/identifier.
Definition Log.h:39
 
const char * getHelp() const noexcept
See Cpl::TShell::Command.
Definition Log.h:65
 
Cpl::TShell::Command::Result_T execute(Cpl::TShell::Context_ &context, char *cmdString, Cpl::Io::Output &outfd) noexcept
See Cpl::TShell::Command.
 
Cpl::Persistent::IndexedEntryServer< Cpl::Logging::EntryData_T > & m_logServer
Log Entry Server.
Definition Log.h:95
 
const char * getUsage() const noexcept
See Cpl::TShell::Command `.
Definition Log.h:62
 
bool getPreviousLogEntry(Cpl::Persistent::GetPreviousRequest::Payload &payload) noexcept
Helper method.
 
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.
 
This concrete template class implements the ITC messaging (and Model Point monitoring) needed to prov...
Definition IndexedEntryServer.h:51
 
This partially concrete class implements infrastructure and/or common functionality for a Shell comma...
Definition Command.h:37
 
Result_T
Possible result codes when executing a command.
Definition Command.h:35
 
This Private Namespace class defines a "Context" for a TShell command.
Definition Context_.h:32
 
Permission_T
Permissions levels.
Definition Security.h:34
 
This abstract class defines the operations that can be before on a NULL terminated string.
Definition String.h:40
 
The 'Cpl' namespace is the root name space for the Colony.
Definition Api16.h:20