Click here to Skip to main content
Licence 
First Posted 3 Mar 2004
Views 29,445
Bookmarked 17 times

Low-level-interference logging

By | 1 Mar 2006 | Article
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

About the Author

Lymington

Web Developer

United Kingdom United Kingdom

Member

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)

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMight be useful... PinmemberHans Dietrich7:02 8 Apr '05  
But as other people have pointed out, I would have to dive into code to find out, since article has very few details.
 
One thing I look for in articles is how the code is structured. Very often, even if I can't use the component (or whatever), I find that there are useful functions, snippets of code, etc., that I can immediately reuse. Some comments about the code structure, classes, key functions, etc., would be very helpful.
 
Best wishes,
Hans

GeneralComments Pinmemberpeterchen7:29 4 May '04  
GeneralRe: Comments PinmemberLymington21:21 4 May '04  
QuestionQuality? PinmemberPeter Ritchie7:50 9 Mar '04  

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.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120528.1 | Last Updated 1 Mar 2006
Article Copyright 2004 by Lymington
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid