Click here to Skip to main content
Click here to Skip to main content

Low-level-interference logging

, 1 Mar 2006
Rate this:
Please Sign up or sign in to vote.
Low-level-interference logging.

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.

//
// The filing thread runs at the priority of the 
// thread that calls ...InitStd
//
// Screen shot is for "PGOmailServer","PGO" & 
// files appear in the running directory
//
  Jprintf_InitStd("FileName","MarkerFileExtention");
        // once only, probably on the main thread
  ...
  ...
  Jprintf_StampP("dataToBeTimeStamppedAndLogged");// many, any thread
  ...
  ...
  Jprintf_P("dataToBeLogged");// many, any thread
  ...
  ...
  Jprintf_Term();// once only, probably on the main thread

History

  • 3.5 - Note: logging directory to be Default at Init time.
  • 3.4 - Comment/logging maintenance.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Lymington
Web Developer
United Kingdom United Kingdom
BSc (St.Andrews(1963-67))
MSCE
Systems Programmer 39+yrs
Married to first wife 35yrs & counting, four grown-up children
Religious opinions similar to MelG's
It is not the gnosis, but the praxis must be the fruit. (Aristotle)

Comments and Discussions

 
GeneralMight be useful... PinmemberHans Dietrich8-Apr-05 7:02 
GeneralComments Pinmemberpeterchen4-May-04 7:29 
GeneralRe: Comments PinmemberLymington4-May-04 21:21 
QuestionQuality? PinmemberPeter Ritchie9-Mar-04 7:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 1 Mar 2006
Article Copyright 2004 by Lymington
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid