InstallContext.LogMessage(String) 메서드

정의

설치를 위해 콘솔 및 로그 파일에 메시지를 씁니다.

public:
 void LogMessage(System::String ^ message);
public void LogMessage(string message);
member this.LogMessage : string -> unit
Public Sub LogMessage (message As String)

매개 변수

message
String

쓸 메시지입니다.

예제

이 예제는 클래스의 클래스 개요에 있는 예제의 InstallContext 발췌입니다.

메서드를 IsParameterTrue 사용하여 매개 변수가 LogtoConsole 설정되었는지 확인합니다. 이 경우 yes이 메서드를 LogMessage 사용하여 설치 로그 파일 및 콘솔에 상태 메시지를 씁니다.

// Check whether the "LogtoConsole" parameter has been set.
if ( myInstallContext->IsParameterTrue( "LogtoConsole" ) )
{
   // Display the message to the console and add it to the logfile.
   myInstallContext->LogMessage( "The 'Install' method has been called" );
}
// Check whether the "LogtoConsole" parameter has been set.
if ( myInstallContext.IsParameterTrue( "LogtoConsole" ))
{
   // Display the message to the console and add it to the logfile.
   myInstallContext.LogMessage( "The 'Install' method has been called" );
}
' Check wether the "LogtoConsole" parameter has been set.
If myInstallContext.IsParameterTrue("LogtoConsole") = True Then
   ' Display the message to the console and add it to the logfile.
   myInstallContext.LogMessage("The 'Install' method has been called")
End If

설명

설치 관리자는 이 메서드를 호출하여 진행률 또는 기타 상태 정보를 로그 파일에 쓸 수 있습니다. 명령줄 매개 변수가 사용자 인터페이스를 표시하도록 지정하는 경우 설치 관리자는 메서드 호출 LogMessage 외에 메시지 상자를 표시하거나 쿼리를 만들어야 합니다. 설치를 실행하는 데 InstallUtil.exe 사용하고 명령줄에 "/LogToConsole= true"를 지정하지 않으면 로그 파일에 기록된 텍스트가 사용자에게 표시되지 않습니다.

적용 대상

추가 정보