Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

logging

Status
Not open for further replies.

anithashetty

Programmer
May 6, 2003
25
IN
how to log a application error or information in pb
in java we will use log4j like that how to do in pb
 
Hello,
I think the best is to create a user object
which open a file (in LineMode!) when instanciated and close it when destroyed, with a fileWrite function.
Declare it as a global, and each time you need, just call the write function.

user object : uo_Log

uo_log instance variable
--> int ii_fileNumber

uo_Log::constructor
--> ii_fileNumber = FileOpen(FileName,LineMode!,Write!,LockWrite!,Append!)

uo_Log::uof_WriteLog(string as_Text)
--> FileWrite(ii_FileNumber,as_Text)

uo_Log::destructor
--> FileClose(ii_fileNumber)

Global variable
--> uo_Log MyLog

Application::constructor
--> MyLog = Create uo_Log

Each time you need
--> MyLog.uof_WriteLog("Hello World")

Hope it will be helpfull

Thierry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top