Debugging Tools for Windows

OpenLogFile

The OpenLogFile and OpenLogFileWide methods open a log file that will receive output from the client objects.

HRESULT
  IDebugControl::OpenLogFile(
    IN PCSTR  File,
    IN BOOL  Append
    );

HRESULT
  IDebugControl4::OpenLogFileWide(
    IN PCWSTR  File,
    IN BOOL  Append
    );

#ifdef UNICODE
#define OpenLogFileT OpenLogFileWide
#else
#define OpenLogFileT OpenLogFile
#endif

Parameters

File
Specifies the name of the log file. File can include a relative or absolute path; relative paths are relative to the directory in which the debugger was started. If the file does not exist, it will be created.
Append
Specifies whether or not to append log messages to an existing log file. If TRUE, log messages will be appended to the file; if FALSE, the contents of any existing file matching File are discarded.

Return Value

S_OK
The method was successful.

This method can also return error values. See Return Values for more details.

Interface Version

OpenLogFile is available in all versions of IDebugControl. OpenLogFileWide is available in IDebugControl4 and later versions.

Comments

OpenLogFile and OpenLogFileWide behave the same way as OpenLogFile2 and OpenLogFile2Wide with Flags set to DEBUG_LOG_APPEND if Append is TRUE and DEBUG_LOG_DEFAULT otherwise.

Only one log file can be open at a time. If there is already a log file open, it will be closed.

For more information about log files, see Using Input and Output.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

OpenLogFile2, GetLogFile, CloseLogFile, GetLogMask, SetLogMask, .logopen (Open Log File), .logappend (Append Log File)

Build machine: CAPEBUILD