Debugging Tools for Windows

OpenLogFile2

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

HRESULT
  IDebugControl4::OpenLogFile2(
    IN PCSTR  File,
    IN ULONG  Flags
    );

HRESULT
  IDebugControl4::OpenLogFile2Wide(
    IN PCWSTR  File,
    IN ULONG  Flags
    );

#ifdef UNICODE
#define OpenLogFile2T OpenLogFile2Wide
#else
#define OpenLogFile2T OpenLogFile2
#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.
Flags
Specifies the bit-flags that control the nature of the log file. Flags can contain flags from the following table.
Flag Effect when set
DEBUG_LOG_APPEND Output will be appended to the log file instead of discarding the contents of the log file.
DEBUG_LOG_UNICODE The format of the log file will be Unicode instead of ASCII.

Alternatively, Flags can be set to DEBUG_LOG_DEFAULT for the default set of options that contains none of the flags.

Return Value

S_OK
The method was successful.

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

Interface Version

OpenLogFile2 and OpenLogFile2Wide are available in IDebugControl4 and later versions.

Comments

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

OpenLogFile, GetLogFile2, CloseLogFile, GetLogMask, SetLogMask, .logopen (Open Log File), .logappend (Append Log File)

Build machine: CAPEBUILD