Grant's CGI Framework
Documentation: Display and Logging

Version: 2.0d6
Release Date: Tuesday, October 14, 1997
Expires no later than: December 31, 1997

Important: THIS DOCUMENTATION IS INCOMPLETE AND PROBABLY A BIT INACCURATE

It is subject to change as the API matures.
Feedback and contributions are encouraged:

grantcgi@list.nisto.com
or grant@achilles.net

Plug-ins may use the web server's log file, or their own log file.
Display support is not yet implemented for CGIs.


Server Actions

DisplayString

CGIErr DisplayString ( APIData apidata, char *theString )

Takes a C format (null terminated) string and writes it to the log file. Appends a linebreak after the entry.

ServerLogWriteEntry

CGIErr ServerLogWriteEntry ( APIData apidata, char *theString )

Takes a C format (null terminated) string and writes it to the server's log file. Appends a linebreak after the entry.

Note: not implemented when compiling as a CGI.

LogRegisterAsLogging

CGIErr LogRegisterAsLogging ( APIData apidata )

"By making this call, your plug-in is registered to receive logging messages. Logging plug-ins can perform the same functions as post-processors and are invoked immediately after any post-processor function. There can be multiple logging plug-ins." "When a plug-in is invoked with a logging message, the HTTP connection to the client is already closed. All connection-related parameters/fields are available to the logging plug-in, but no HTTP communications functions will be allowed." -- WSAPI 1.2


CUSTOM LOG FILE SUPPORT

LogWriteEntry

CGIErr LogWriteEntry ( APIData apidata, char *theString )

Takes a C format (null terminated) string and writes it to the log file. Appends a linebreak after the entry.

LogWriteDebugEntry

CGIErr LogWriteDebugEntry ( APIData apidata, char *theString, char *theFileString, UInt16 theLineNumber )

This call should generally be used in the form: LogWriteDebugEntry ( apidata, "some message", __FILE__, __LINE__ );

LogStartup

OSErr LogStartup ( void )

Initialize the log file.

LogQuit

OSErr LogQuit ( void )

LogFileOpen

OSErr LogFileOpen ( void )

Open the log file for writing. Writing will begin at the end of the file (appending)

LogFileClose

OSErr LogFileClose ( void )

Close the log file.

LogFileFlush

OSErr LogFileFlush ( void )

This function should be called periodically after data has been written to the log file. It helps to ensure that the data is not lost if there is a crash before the file is closed.


CGI Only Log Functions

LogString

OSErr LogString ( const char *theString )

Takes a C format string and writes it to the log file. Does not append linebreak or any other character so the next write to the log file will follow directly after this write. If you want to have theString followed by a linebreak, you need to call one of the functions that appends a separator character after theString.

LogStringP

OSErr LogStringP ( const StringPtr theString )

Does not append linebreak or any other character so the next write to the log file will follow directly after this write. If you want to have theString followed by a linebreak, you need to call one of the functions that appends a separator character after theString.

theString
a Pascal format string (max 255 characters + size byte).

LogStringAndSeparator

OSErr LogStringAndSeparator ( const char *theString, char theSeparator )

Takes a C format string and writes it to the log file. Appends theSeparator after theString. This may be used for writing theString followed by a linefeed, or perhaps a tab character, among other uses.

LogStringAndSeparatorP

OSErr LogStringAndSeparatorP ( const StringPtr theString, char theSeparator )

Same as 'LogStringAndSeparator', except for string format.

theString
a Pascal format string (max 255 characters).

DEBUG LOGGING

These functions will prepend "DEBUG: " in the log file before writing theString that is passed to them.
The functions are prototyped in "LogUtil.h" to map to NULL (do nothing) if the 'kCompileWithDebugLogging' option is off in "MyConfiguration.h"

LogStringDebug

OSErr LogStringDebug ( const char *theString )

LogStringDebugP

OSErr LogStringDebugP ( const StringPtr theString )


Grant's CGI Framework

Contents: Nisto - Products - Mail Lists - Cree - Standards - Babylon 5

Privacy Statement, Legal Notices
Copyright ©1997-1998 Grant Neufeld. All rights reserved. abc