|
| HTTPnotificationPublisher (const char *name) |
|
virtual | ~HTTPnotificationPublisher () |
|
void | addInterestedClient (HTTPnotificationReceiverInterface *client) |
|
void | killProcessingThread () |
|
uint_fast32_t | getLogPrefixMask () const OME_ALWAYS_INLINE |
| Get current log prefix mask. It will be a combination of bits composed from LogMessageRecord::LogPrefixMask enums. More...
|
|
uint_fast32_t | setLogPrefixMask (uint_fast32_t newMask) OME_ALWAYS_INLINE |
| Set the log prefix mask. The new mask is defined as a combination of bits created by OR'ing together values from the LogMessageRecord::LogPrefixMask enum. More...
|
|
void | setStripLeadingDirectories (uint_fast32_t dirCount) |
|
BufferRegion * | getBufferManager () const OME_ALWAYS_INLINE |
| Provide access to the underlying BufferRegion. More...
|
|
IO_Processor * | get_IO_Manager () const OME_ALWAYS_INLINE |
| Provide access to underlying IO_Processor. More...
|
|
| LogManager (SharedMemoryVariableNode *parentNode, OS_HANDLE_TYPE output_fd, uint_fast8_t useSeparateThread, const char *appName, uint_fast32_t logLinePrefixMask=~0U, uint_fast32_t maxLineSize=(LogManager::MAX_LOG_LINE_LENGTH - sizeof(SharedBufferAllocRecord)), unsigned char *region=nullptr, size_t bytes=(LogManager::MAX_LOG_LINE_LENGTH *64)) |
| Create anonymous buffer. More...
|
|
virtual | ~LogManager () |
|
int | closeLog () |
| Close the open log file. More...
|
|
SharedBufferAllocRecord * | allocateBuffer () OME_ALWAYS_INLINE |
| Allocate a buffer for a log record. More...
|
|
void | returnBuffer (SharedBufferAllocRecord *rec) OME_ALWAYS_INLINE |
| Return a buffer previously allocated by allocateBuffer(). More...
|
|
unsigned char * | bufferAddress (SharedBufferAllocRecord *rec, size_t *bufferLen=nullptr) const OME_ALWAYS_INLINE |
| Obtain the physical address and length of a buffer from a SharedBufferAllocRecord, which are data structures intended for use in shared memory segments and utilize relative offsets, enabling simultaneous use by distinct processes that have a segment mapped to different address regions. More...
|
|
ssize_t | writeDataToBuffer (SharedBufferAllocRecord *rec) |
| Low-level routine to add a record to log buffer. More...
|
|
ssize_t | copyAndWriteDataToBuffer (SharedBufferAllocRecord *rec, const void *data, size_t len) |
| Low-level routine to copy data and add a record to log buffer. More...
|
|
ssize_t | copyAndWriteData (const void *data, size_t len) |
| Write block of data to the log buffer. More...
|
|
const TextBlock_struct | pruneDirectoryPrefix (const char *fileName, const int_fast32_t fileNameLen) |
| Return the source file name pruned of any leading directory components as indicated by settings imposed by setStripLeadingDirectories() and the stripFilePrefix table. More...
|
|
const char * | getErrorCondition () const OME_ALWAYS_INLINE |
| Return error condition text detected. This is normally used to obtain an explanation of errors reported by the operating system when attempting to write log records. More...
|
|
void | setErrorCondition (const char *messageText) OME_ALWAYS_INLINE |
| Set error condition text. More...
|
|
void | setTimeAcquisitionRoutine (TimeAcquisitionFP routine) |
| Set alternate timestamp acquisition routine. More...
|
|
TimeAcquisitionFP | getTimeAcquisitionRoutine () const OME_ALWAYS_INLINE |
| Return pointer to the time acquistion routine associated with the log. More...
|
|
void | getTimestamp (struct timespec *timestamp) const OME_ALWAYS_INLINE |
| Return the current time using the timestamp acquisition routine associated with the log. More...
|
|
|
static int | forwardToClients (SharedBufferAllocRecord *rec, IO_Processor *controller) |
|
static void | defaultGetTime (struct timespec *timestamp, const LogManager *logMgr) |
|
static uint_fast32_t | addLogComponent (const char *componentName, LogMaskType_t *maskLocation, LogMaskPrimitiveType_t initialMask=0) |
| Add definition of new log component. More...
|
|
static int | initializeLogSubsystem (int *newArgc, const char **newArgv, const int argc, const char *argv[], const char *componentName=nullptr, LogMaskType_t *appMaskLocation=nullptr, const uint_fast32_t maxLines=128, const LogMaskPrimitiveType_t logPrefixMask=~0U) |
| Initialize logging-specific parameters by passing command line arguments. More...
|
|
static LogManager * | newLogToFileDescriptor (SharedMemoryVariableNode *parentNode, OS_HANDLE_TYPE fd, LogMaskPrimitiveType_t logPrefixMask, uint_fast8_t useSeparateThreads, unsigned char *region, size_t bytes) |
|
static LogManager * | newLogFileForComponent (SharedMemoryVariableNode *parentNode, const char *app, uint_fast32_t filenameCreateFlags, LogMaskPrimitiveType_t logPrefixMask, uint_fast8_t enableMap, uint_fast8_t useSeparateThreads, size_t desiredRegionSize=0, size_t reserveAtEnd=0, const char *inDir=getenv(DEFAULT_LOG_DIRECTORY_ENVIRONMENT_VARIABLE)) |
| Create a new file and LogManager for a component. If desired, also create an auxilary backing file for the buffer and create a background thread to perform the actual output. More...
|
|
static LogManager * | newStandardLogFile (const char *namedComponent=nullptr, LogMaskPrimitiveType_t filenameCreateFlags=~0U, SharedMemoryVariableNode *parentNode=nullptr) |
| High-level routine to create a standard log file associated with a component. More...
|
|
static int | commitLogRecord (SharedBufferAllocRecord *rec, IO_Processor *controller) |
| IO_processor-compatible process routine used to write buffered data to an open file. More...
|
|
static void | setSourceForCustomLogTime (POSIXtimeInNanoseconds *timeSource) |
| Convenience routine to set location of a custom time value for log lines. More...
|
|
static void | returnCustomLogTime (struct timespec *timestamp, const LogManager *logMgr) |
| Convenience routine to retrieve a custom timestamp for log lines. More...
|
|
Base class for converting a LogManager into a publisher that outputs log event messages to multiple attached clients.
The actual interesting work must be done by a derived class of HTTPnotificationReceiverInterface. This class really provides very generic functionality and can be exploited for other purposes.