Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 2.28 KB

README.md

File metadata and controls

33 lines (25 loc) · 2.28 KB

TextLogger

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...

API

The API is very simple and small, there are only three main methods

addMessage( string )

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.

getActEntry()

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.

getEntryCount()

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.

Type TextLogger.loggingBufferEntry

The buffer is an array out of this type with the size given in the constructor.

Author & Info

Matthias S.
matthias [at] seehauser [dot] at
https://www.seesle.at MCI - Mechatronics https://www.mci.at

License

Creative Commons Lizenzvertrag
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.