Logtext - Documentation - ProvideX Example Code
Home - Download - Documentation - Forum - Bug Report - Contact - License Agreement - External Links
 
 
 
 
LOGTEXT.DLL: Direct link library (DLL) logtext.dll - Documentation
 
LOGTEXT.EXE: Command line utility (executable) logtext.exe - Documentation
 
 
Example code on how to use the DLL logtext.dll with ProvideX
 
This example program has been provided by Stéphane Devouard and Todd Andrews.
 
 
! WORKING EXAMPLE OF LOGTEXT.DLL FOR VERSION 1.6.18 USING sLogText()
! WRITTEN FOR PROVIDEX VERSION 6.20 (WILL PROBABLY WORK WITH OTHER PVX VERSIONS) -- www.pvx.com
! 2007-11-03
! Stéphane Devouard, Todd Andrews
!
! INITIALIZE
!
! LO_ VARIABLES TAKEN FROM LOGGING OPTIONS IN LOGTEXT.H
!
LO_ECHO                 =DEC($00000001$)
LO_ECHO_ONLY            =DEC($00000002$)
LO_QUICK                =DEC($00000004$)
LO_LOGNAME_ONLY         =DEC($00000008$)
LO_INCLUDE_APP          =DEC($00000010$)
LO_NO_DATE              =DEC($00000020$)
LO_DAILY                =DEC($00000040$)      ! Default. Create a new log file daily.
LO_WEEKLY               =DEC($00000080$)      ! Create a new log file weekly.
LO_MONTHLY              =DEC($00000100$)
LO_YEARLY               =DEC($00000200$)
LO_LINES                =DEC($00000400$)
LO_SIZE                 =DEC($00000800$)
LO_DELETE_ZIPS          =DEC($00001000$)
LO_DELETE_LOGS          =DEC($00002000$)
LO_DONT_LOG_DELETION    =DEC($00004000$)
LO_DONT_ZIP             =DEC($00008000$)
LO_DONT_LOG_ZIPPING     =DEC($00010000$)
LO_NO_BANNER            =DEC($00020000$)      ! Don't log the startup message
LO_TIME_T               =DEC($00040000$)      ! Use 'T' to seperate date/time and event text
LO_STDERR               =DEC($00080000$)
LO_USER_ISO_DATE        =DEC($00100000$)
LO_REG_ISO_DATE         =DEC($00200000$)
LO_KEEP_CRLF            =DEC($00400000$)
LO_DONT_LOG_REGISTRY    =DEC($00800000$)      ! Don't log changes to the registry.
LO_LOGNAME              =DEC($01000000$)      ! Leave the log file's name for the caller
LO_DONT_LOG_ACTIONS     =LO_DONT_LOG_DELETION + LO_DONT_LOG_ZIPPING + LO_DONT_LOG_REGISTRY
!
LOGTEXT_L               =DLL(ADDR "logtext.dll")             ! "ADDR" Uses LoadLibrary() Windows API
LOGTEXT_F$              ="sLogText"                          ! Function to use; sLogText does NOT use logtext.ini
LOGTEXT_A               =DLL(FIND LOGTEXT_L,LOGTEXT_F$+$00$) ! "FIND" Uses GetProcAddress() Windows API, _stdcall method; strings must be terminated with hex zero $00$
LOGTEXT_LOG$            ="C:\LogFile"                        ! chApplication
LOGTEXT_FLAGS           =LO_ECHO + LO_WEEKLY + LO_TIME_T     ! dwOptions -- add decimal values together to turn on desired flags
LOGTEXT_MAX_LOGS        =2                                   ! ulMaxLogs -- keep 2 log files
LOGTEXT_MAX_ZIPS        =10                                  ! ulMaxZips -- and 10 compressed files
!
! END OF INITIALIZATION
!
! READY TO WRITE TO LOG FILE
X=DLL(*,LOGTEXT_A,LOGTEXT_LOG$+$00$,"This is our text to log"+$00$,LOGTEXT_FLAGS,LOGTEXT_MAX_LOGS,LOGTEXT_MAX_ZIPS) ! WRITE TO LOG; DON'T FORGET TO TERMINATE STRINGS WITH HEX ZERO $00$
X=DLL(*,LOGTEXT_A,LOGTEXT_LOG$+$00$,"That's the second event to log"+$00$,LOGTEXT_FLAGS,LOGTEXT_MAX_LOGS,LOGTEXT_MAX_ZIPS)
X=DLL(*,LOGTEXT_A,LOGTEXT_LOG$+$00$,"That's the third event to log"+$00$,LOGTEXT_FLAGS,LOGTEXT_MAX_LOGS,LOGTEXT_MAX_ZIPS)
	
 
 
 
 
 
 

Home - Download - Documentation - Forum - Bug Report - Contact - License Agreement - External Links