Go to the documentation of this file. 1 #ifndef _READ_BINARY_LOG_HPP_
2 #define _READ_BINARY_LOG_HPP_ "$Id: read_binary_log.hpp 428 2020-07-17 17:16:27Z geoff $"
20 #pragma GCC diagnostic push
21 #pragma GCC diagnostic ignored "-Wsuggest-final-types"
97 virtual int processRecord(
const unsigned char *data,
size_t recLen);
101 #pragma GCC diagnostic pop
@ OUTPUT_DATE
Definition: time_point.hpp:599
uint32_t formatStringLen
Definition: read_binary_log.hpp:30
@ LOG_ERROR_LEVEL
Include level indicator (INFO, ERROR, etc.)
Definition: logging_api.hpp:1042
Reads a binary log, expands and formats as original plain text. If provided a text file,...
Definition: read_binary_log.hpp:22
FARGOS file processing infrastructure.
virtual int outputAssembledLine()
Process a binary log message buffer and convert to a formatted log line, then invoke processLine() to...
Definition: read_binary_log.cpp:21
LogLineBinaryHeader * lineHeader
Definition: read_binary_log.hpp:35
@ WANT_ARG_VALUE
Definition: read_binary_log.hpp:25
Allocation record for chains in a 32-bit shared memory buffer.
Definition: circular_bfr.hpp:103
virtual unsigned char * blockAddress(const SharedBufferAllocRecord *record)
Definition: circular_bfr.hpp:282
@ WANT_LINE_END
Definition: read_binary_log.hpp:25
uint32_t processedArgCount
Definition: read_binary_log.hpp:27
virtual SharedBufferAllocRecord * getActiveListHead()
Return first active allocation record.
Definition: circular_bfr.cpp:196
char * formatIntoString(char *bfr, uint_fast8_t bfrLen, uint_fast8_t *resultLen=nullptr, uint_fast8_t fieldsWanted=OUTPUT_DATE|OUTPUT_TIME, const char *fieldSeparators="/:. ") const
Format into text string.
Definition: time_point.hpp:1273
const unsigned char * argData[LogMessageRecord::LOG_MAX_ARGUMENT_TOTAL]
Definition: read_binary_log.hpp:37
const char byteAsLowercaseHexadecimal[256][3]
Table of uppercase hexadecimal characters for each byte value.
Definition: text2int.cpp:38
ReadBinaryLog(OS_HANDLE_TYPE fd, OS_HANDLE_TYPE outputTo=_STDOUT_FD)
Definition: read_binary_log.hpp:43
uint32_t processedByteCount
Definition: read_binary_log.hpp:77
static const char * getSeverityLabel(uint_fast32_t level)
Definition: logging_api.cpp:432
Implements an adjustable sliding buffer that minimizes data movement while enabling streams to proces...
Definition: read_file.hpp:38
Cache locale-specific time data around a particular point in time.
Definition: time_point.hpp:92
@ OUTPUT_TIME
Definition: time_point.hpp:600
uint32_t parseState
Definition: read_binary_log.hpp:26
uint32_t usedByteCount
Definition: read_binary_log.hpp:78
#define VIRTUAL_OVERRIDE
Generates override if the compiler supports it.
Definition: compiler_hints.h:435
int traverseBlockChain(const SharedBufferAllocRecord *start)
Definition: read_binary_log.cpp:483
unsigned char * getBufferBase() const OME_ALWAYS_INLINE
Return the address of the buffer region.
Definition: circular_bfr.hpp:253
OS_HANDLE_TYPE outputToFD
Definition: read_binary_log.hpp:31
CircularBufferManager * bfrMgr
Definition: read_binary_log.hpp:75
virtual int processLine(const unsigned char *line, size_t lineLen) VIRTUAL_OVERRIDE
Writes data to output descriptor.
Definition: read_binary_log.cpp:258
Interface and generic implementation to traverse elements in a memory-mapped region under the control...
Definition: read_binary_log.hpp:73
size_t getRegionLength() const OME_ALWAYS_INLINE
Return the number of bytes in the region.
Definition: circular_bfr.hpp:243
virtual int processBufferContents()
Definition: read_binary_log.cpp:499
virtual SharedBufferAllocRecord * traverseNextBlock(SharedBufferAllocRecord *record)
Traverse to next allocation record on current chain.
Definition: circular_bfr.cpp:233
@ LOG_FILENAME
Include source filename on logline.
Definition: logging_api.hpp:1040
@ LOG_ARG_TYPE_INT64
Definition: logging_api.hpp:1098
#define MAP_FILE_READONLY
Definition: mapped_file.h:66
~ReadMappedCircularBuffer()
Definition: read_binary_log.cpp:449
#define OME_PREFETCH(addr, rw, locality)
Macro to request prefetch.
Definition: compiler_hints.h:362
time_t getSeconds() const OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3")
Convert a POSIXtimeInUnits to seconds since the POSIX epoch.
Definition: time_point.hpp:489
@ WANT_FILENAME
Definition: read_binary_log.hpp:24
void adjustBufferStart(size_t amount) OME_ALWAYS_INLINE
Adjusts the start of the active content in the buffer.
Definition: read_file.hpp:163
char * fixedpoint_to_ascii(char *resultBfr, uint_fast8_t bfrLen, int64_t value, uint_fast8_t precision, uint_fast8_t *retStrLen, int_fast8_t outputPrecision)
Format a fixed-point value with indicated decimal places.
Definition: text2int.cpp:2734
uint32_t processedBlockCount
Definition: read_binary_log.hpp:76
const char srcID[]
Definition: catSym.c:17
#define LOGFILE_BFR_MAGIC_NUMBER
Magic number for shared memory log file buffer.
Definition: logging_api.hpp:103
#define MAX_LINE_LEN
Definition: catSym.c:15
@ LOG_MAX_ARGUMENT_TOTAL
Maximum number of arguments for an output line.
Definition: logging_api.hpp:1030
Represents a single binary log element.
Definition: logging_api.hpp:145
@ LOG_LINE_NUMBER
Include source line number on logline.
Definition: logging_api.hpp:1041
@ WANT_FORMAT
Definition: read_binary_log.hpp:24
#define OME_EXPECT_TRUE(expr)
Annotation macro for conditional expression expected to be true.
Definition: compiler_hints.h:541
TimePointCache * timePointCache
Definition: read_binary_log.hpp:34
Representation of localized expanded UNITS-since-epoch.
Definition: time_point.hpp:596
virtual int processEndOfBuffer()
Definition: read_binary_log.cpp:468
@ WANT_LINE_HEADER
Definition: read_binary_log.hpp:24
Representation of UNITS-since-POSIX-epoch. This is an unambiguous time reference; there is no locale-...
Definition: time_point.hpp:313
Fundamental class that can read data from a memory-mapped region, file or socket and process data in ...
Definition: read_file.hpp:244
LogMaskType_t COMPONENT_LOG_MASK() app("app_logMask", &DEFAULT_sharedMemoryVariableManager, COMPONENT_LEVEL(app, defaultMask))
const char * formatString
Definition: read_binary_log.hpp:33
const char * fileName
Definition: read_binary_log.hpp:32
void discardInitialBytes(size_t bytes=0) OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3")
Discards bytes from the beginning of the active portion of the buffer; typically as a result of havin...
Definition: read_file.hpp:171
ReadMappedCircularBuffer(const char *fileName)
Definition: read_binary_log.cpp:432
LogLineBinaryValueHeader * argHeader[LogMessageRecord::LOG_MAX_ARGUMENT_TOTAL]
Definition: read_binary_log.hpp:36
@ COPY_AS_IS
Definition: read_binary_log.hpp:25
OS_HANDLE_TYPE setNewOutputDescriptor(OS_HANDLE_TYPE newFD)
Definition: read_binary_log.hpp:56
const char srcID[] OME_USED
Definition: tick_time.cpp:24
@ LOG_THREAD_ID
Include thread id on logline.
Definition: logging_api.hpp:1039
@ WANT_ARG_HEADER
Definition: read_binary_log.hpp:24
@ LOG_TIMESTAMP
Include time on logline.
Definition: logging_api.hpp:1038
size_t spaceUsed() const OME_ALWAYS_INLINE
Returns the amount of space current used in the buffer.
Definition: read_file.hpp:125
Impose a circular buffer on a BufferRegion.
Definition: circular_bfr.hpp:330
virtual int processRecord(const unsigned char *data, size_t recLen)
Definition: read_binary_log.cpp:458
unsigned char * startBufferLocation() const OME_ALWAYS_INLINE
Returns the start of the active content in the buffer.
Definition: read_file.hpp:131
#define LOG_COMPONENT_CERR(component, lvl)
Convenience macro that uses LOG_COMPONENT_INTO to conditionally log a message to standard error.
Definition: logging_api.hpp:3030
uint32_t usedLen
Definition: circular_bfr.hpp:107
uint32_t blockLen
Definition: circular_bfr.hpp:106
#define _STDOUT_FD
Platform-independent reference to standard out.
Definition: logging_api.hpp:2616
~ReadBinaryLog()
Definition: read_binary_log.hpp:52
uint32_t recordsProcessed
Definition: read_file.hpp:283
@ LOG_DATESTAMP
Include date on logline.
Definition: logging_api.hpp:1037
@ LOG_ARG_TYPE_HEX_FRAGMENT_UPPER
Definition: logging_api.hpp:1109
uint32_t _pad
Definition: read_binary_log.hpp:79
#define LOG_ENDLINE
Closing clause for text line output using << operators.
Definition: logging_api.hpp:2956
uint32_t parseOffset
Definition: read_binary_log.hpp:28
#define OS_HANDLE_TYPE
Definition: io_processor.hpp:48
@ LOG_ARG_TYPE_HEX_FRAGMENT
Definition: logging_api.hpp:1108
const char byteAsUppercaseHexadecimal[256][3]
Table of uppercase hexadecimal characters for each byte value.
Definition: text2int.cpp:78
uint32_t fileNameLen
Definition: read_binary_log.hpp:29
virtual int processRegionHeader(const SharedBufferRegionHeader *hdr, size_t segmentLen)
Definition: read_binary_log.cpp:463
virtual int processBlock(const SharedBufferAllocRecord *record)
Definition: read_binary_log.cpp:474
char * uint_to_ascii(uint32_t resultBfr[], uint_fast8_t bfrLen, uint64_t value, uint_fast8_t *retStrLen)
Quickly convert a binary integer into ASCII decimal text.
Definition: text2int.cpp:2628
@ LOG_ARG_TYPE_DOUBLE
Definition: logging_api.hpp:1101
@ LOG_LINE_BINARY_FORMAT_VER1
Denotes version of 1 of the header format.
Definition: logging_api.hpp:191
static unsigned char * createSegment(const char *fileName, size_t *segmentLengthPtr, int initMode=MAP_FILE_INIT, const char *desiredMagicNumber=SMV_MAGIC_NUMBER)
Open a file and map it to a memory segment for variable storage.
Definition: shared_variable.cpp:342
virtual int processBuffer(File_Buffer *bfrState) VIRTUAL_OVERRIDE
Process buffer contents.
Definition: read_binary_log.cpp:278
int fd
Definition: ethers.c:41
@ LOG_LINE_BINARY_FORMAT_LE
Indicates little-endian, IEEE 754 floating point format.
Definition: logging_api.hpp:193
File_Buffer * intermediateBuffer
Definition: read_file.hpp:278
@ CHECK_FOR_BINARY_HEADER
Definition: read_binary_log.hpp:25
#define LOG_CERR(lvl)
Convenience macro that uses LOG_INTO() to conditionally log a message to standard error.
Definition: logging_api.hpp:3014