Writing Log Entries in a Text Log

An application performs one of the following to write a log entry in a SetupAPI text log:

  • Calls SetupWriteTextLog to write a single text log entry that contains information about an installation event.

  • Calls SetupWriteTextLogError to write information about a SetupAPI-specific error or a Win32 error to a text log. SetupWriteTextLogError writes two consecutive entries to a text log: the first entry contains the same information in the same format as that written by SetupWriteTextLog and the second entry logs a corresponding error code and a user-friendly description of the error.

  • Calls SetupWriteTextLogInfLine to write a single text log entry that contains the text of a specified INF file line.

As described in Format of a Text Log Section Body, the SetupAPI logging functions write entries in the following format:

entry_prefix time_stamp event_category indentation formatted_message

The main difference between the entries that the various SetupAPI logging functions write to a text log is in the specific information content and in the format of the formatted-message field.

For information about how to set the indentation field to indent the formatted-message field, see Writing Indented Log Entries.