ISharePointCommandLogger.WriteLine 方法

定义

重载

WriteLine(String, LogCategory)

将消息写入具有指定类别的“输出”窗口或“错误列表”窗口。Writes a message to the Output window or Error List window with the specified category.

WriteLine(String, LogCategory, String)

将消息写入具有指定类别和“帮助”关键字的“输出”窗口或“错误列表”窗口。Writes a message to the Output window or Error List window with the specified category and Help keyword.

WriteLine(String, LogCategory, String, Int32, Int32)

将消息写入具有指定类别和错误位置信息的“输出”窗口或“错误列表”窗口。Writes a message to the Output window or Error List window with the specified category and error location information.

WriteLine(String, LogCategory, String, Int32, Int32, String)

将消息写入具有指定类别、错误位置信息和“帮助”关键字的“输出”窗口或“错误列表”窗口。Writes a message to the Output window or Error List window with the specified category, error location information, and Help keyword.

WriteLine(String, LogCategory)

将消息写入具有指定类别的“输出”窗口或“错误列表”窗口。Writes a message to the Output window or Error List window with the specified category.

public void WriteLine (string message, Microsoft.VisualStudio.SharePoint.Commands.LogCategory category);

参数

message
String

消息文本。The message text.

category
LogCategory

消息的类别。The category of the message. 这指定消息是否在“输出”窗口和/或“错误列表”窗口中显示,以及消息在“错误列表”窗口的何处显示。This specifies whether the message appears in the Output window or Error List window (or both), and where the message appears in the Error List window.

适用于

WriteLine(String, LogCategory, String)

将消息写入具有指定类别和“帮助”关键字的“输出”窗口或“错误列表”窗口。Writes a message to the Output window or Error List window with the specified category and Help keyword.

public void WriteLine (string message, Microsoft.VisualStudio.SharePoint.Commands.LogCategory category, string helpKeyword);

参数

message
String

消息文本。The message text.

category
LogCategory

消息的类别。The category of the message. 这指定消息是否在“输出”窗口和/或“错误列表”窗口中显示,以及消息在“错误列表”窗口的何处显示。This specifies whether the message appears in the Output window or Error List window (or both), and where the message appears in the Error List window.

helpKeyword
String

此错误的“帮助”关键字。The Help keyword for the error.

适用于

WriteLine(String, LogCategory, String, Int32, Int32)

将消息写入具有指定类别和错误位置信息的“输出”窗口或“错误列表”窗口。Writes a message to the Output window or Error List window with the specified category and error location information.

public void WriteLine (string message, Microsoft.VisualStudio.SharePoint.Commands.LogCategory category, string filePath, int lineNumber, int columnNumber);

参数

message
String

消息文本。The message text.

category
LogCategory

消息的类别。The category of the message. 这指定消息是否在“输出”窗口和/或“错误列表”窗口中显示,以及消息在“错误列表”窗口的何处显示。This specifies whether the message appears in the Output window or Error List window (or both), and where the message appears in the Error List window.

filePath
String

具有错误或警告的文件的完整路径。The full path to the file with the error or warning.

lineNumber
Int32

错误或警告的行号。The line number of the error or warning.

columnNumber
Int32

错误或警告的列号。The column number of the error or warning.

注解

Visual StudioVisual Studio写入 ide 时,如错误窗口, lineNumbercolumnNumber 值从零开始,但当用户代码写入 ide 时,值是从1开始的。When Visual StudioVisual Studio writes to the IDE, such as the Error window, then the lineNumber and columnNumber values are zero-based, but when user code writes to the IDE, then the values are one-based. 这意味着,如果你 lineNumber 在代码中指定了10和 columnNumber 20 的,则会将 Visual StudioVisual Studio 其报告为第11行和第21列。This means that if, for example, you specify a lineNumber of 10 and a columnNumber of 20 in your code, Visual StudioVisual Studio reports it as line 11 and column 21.

适用于

WriteLine(String, LogCategory, String, Int32, Int32, String)

将消息写入具有指定类别、错误位置信息和“帮助”关键字的“输出”窗口或“错误列表”窗口。Writes a message to the Output window or Error List window with the specified category, error location information, and Help keyword.

public void WriteLine (string message, Microsoft.VisualStudio.SharePoint.Commands.LogCategory category, string filePath, int lineNumber, int columnNumber, string helpKeyword);

参数

message
String

消息文本。The message text.

category
LogCategory

消息的类别。The category of the message. 这指定消息是否在“输出”窗口和/或“错误列表”窗口中显示,以及消息在“错误列表”窗口的何处显示。This specifies whether the message appears in the Output window or Error List window (or both), and where the message appears in the Error List window.

filePath
String

具有错误或警告的文件的完整路径。The full path to the file with the error or warning.

lineNumber
Int32

错误或警告的行号。The line number of the error or warning.

columnNumber
Int32

错误或警告的列号。The column number of the error or warning.

helpKeyword
String

此错误的“帮助”关键字。The Help keyword for the error.

注解

Visual StudioVisual Studio写入 ide 时,如错误窗口, lineNumbercolumnNumber 值从零开始,但当用户代码写入 ide 时,值是从1开始的。When Visual StudioVisual Studio writes to the IDE, such as the Error window, then the lineNumber and columnNumber values are zero-based, but when user code writes to the IDE, then the values are one-based. 这意味着,如果你 lineNumber 在代码中指定了10和 columnNumber 20 的,则会将 Visual StudioVisual Studio 其报告为第11行和第21列。This means that if, for example, you specify a lineNumber of 10 and a columnNumber of 20 in your code, Visual StudioVisual Studio reports it as line 11 and column 21.

适用于