Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a log file
Message
 
To
26/02/2003 08:50:19
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00757072
Message ID:
00758051
Views:
19
Claude

I like to use an Event Log for this purpose.

I have an EventLog.DBF with the following structure.
    Prog_Name   C(30)
    Event_Date  D(8)
    Event_Time  C(8)
    Event_Note  C(254)
I use this procedure to record an event.
PROCEDURE RecordEvent
PARAMETERS tcProgName, tcNote

IF ! USED("EventLog")
    USE EventLog IN 0
ENDIF

INSERT INTO EventLog ;
    (Prog_Name, Event_Date, Event_Time, Event_Note) ;
    VALUES (tcProgName, DATE(), TIME(1), tcNote)

USE IN EventLog 
RETURN
When I want to record an event, I insert something like the following.
RecordEvent(PROGRAM(), 'Starting Up, OS: ' + OS() + ', CPU: ' + SYS(17) + ;
            ', Machine: ' + STRTRAN(SYS(0)," ") + ', Mem Avail: ' + ;
            ALLTRIM(TRANSFORM(VAL(SYS(1001)),"999,999,999,999")) + ' bytes' )
or
RecordEvent(PROGRAM(), 'Entering proc')

*** some code

RecordEvent(PROGRAM(), 'Exiting proc')
>I know that the full blown version of what I want to do is called an audit trail. What I would like is a simple method for tracking program flow in a small section of the code to see if code is being executed or not (in this case if tables are update or if a roll back occurs). I quess the closes thing I can think of is a code profiler which if I understand VFP correctly is not available at run time. That is why I wanted to create a text file for a short time. Textmerge way be the way to go.
Dennis Lindeman
Previous
Reply
Map
View

Click here to load this message in the networking platform