This simple C# dll is designed to save text messages with a time stamp and a unique id. The messages are buffered and extracted into a file if there is enough time for it. The buffersize is parameterizable.
The main advantage of this class is to realize logging out of a high performance task without blocking it with file operations. The exportation of these messages can be done in a low priority task, but this is another story, another class..., maybe your own...
The API is very simple and small, there are only three main methods
Add a message as string. After calling, the string is buffered in an internal buffer till getActEntry() is called. Then the read pointer gets incremented.
Returns the actual entry as type of loggingBufferEntry. The struct includes the entry message itself, a timestamp and a unique id. This method works till the entry count is zero, after that it will return null because there is no more entry to return.
Returns the actual count of entries in the buffer. It is the difference between write and read pointer, but correctly counted also if a buffer wrap occured.
The buffer is an array out of this type with the size given in the constructor.
Matthias S.
matthias [at] seehauser [dot] at
https://www.seesle.at
MCI - Mechatronics
https://www.mci.at
KukaMatlabConnector von Matthias Seehauser ist lizenziert unter einer Creative Commons Namensnennung - Weitergabe unter gleichen Bedingungen 4.0 International Lizenz.
Beruht auf dem Werk unter https://www.github.com/seehma/KMC.