Introduction
This DLL provides the routines necessary to achieve low-level-interference run-time textual logging. For a real-time program to log events directly without affecting the execution timings is problematic. This DLL provides a buffered array, which is written to by any of the program threads. This array is output to secondary storage and optionally a screen, by a ‘dedicated’ thread, on a lower priority than the ‘real-time’ threads. The logs are made more manageable by cycling them over time, over a set number of files. Screen prints are optional, and are discontinued when flooding with messages, and continued when such surges of data are passed. File logging always continues, and may even, on occasions, have to be done from higher priority threads.
Background
In the days of multi-threaded DOS programs, the use of some library routines was restricted to the main-thread. (They would only tolerate the main-thread stack.) This DLL grew out of workarounds to this problem. When logging data from time-constrained access to peripherals, it has proved useful. Timing accuracy below 10ms in NT, W2K etc. is available by using the multi-media library WinMM.
Using the code
The Word document JPRfuncts.doc describes all the available routines. A minimum-use set of routines is:- initialization, many (TimeStampedPrints and/or Prints), and termination.
Jprintf_InitStd("FileName","MarkerFileExtention");
...
...
Jprintf_StampP("dataToBeTimeStamppedAndLogged");
...
...
Jprintf_P("dataToBeLogged");
...
...
Jprintf_Term();
History
- 3.5 - Note: logging directory to be Default at Init time.
- 3.4 - Comment/logging maintenance.