InstallContext.LogMessage(String) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
설치를 위해 콘솔 및 로그 파일에 메시지를 씁니다.
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"를 지정하지 않으면 로그 파일에 기록된 텍스트가 사용자에게 표시되지 않습니다.