語言

Formatter.FormatMessage(LogRecord) 方法

定義

將日誌記錄中的訊息字串本地化並格式化。

[Android.Runtime.Register("formatMessage", "(Ljava/util/logging/LogRecord;)Ljava/lang/String;", "GetFormatMessage_Ljava_util_logging_LogRecord_Handler")]
public virtual string? FormatMessage(Java.Util.Logging.LogRecord? record);
[<Android.Runtime.Register("formatMessage", "(Ljava/util/logging/LogRecord;)Ljava/lang/String;", "GetFormatMessage_Ljava_util_logging_LogRecord_Handler")>]
abstract member FormatMessage : Java.Util.Logging.LogRecord -> string
override this.FormatMessage : Java.Util.Logging.LogRecord -> string

參數

record
LogRecord

包含原始訊息的日誌記錄

傳回

本地化且格式化的訊息

屬性

備註

將日誌記錄中的訊息字串本地化並格式化。 此方法提供給 Formatter 子類別在執行格式化時的便利。

訊息字串首先會利用記錄的 ResourceBundle 將格式字串本地化。 (若無 ResourceBundle,或找不到訊息鍵,則將該鍵用作格式字串。)String 格式採用 java.text 風格的格式化。 <ul><li>如果沒有參數,則不使用格式化器。 <li>否則,如果字串包含「{0」,則使用 java.text.MessageFormat 來格式化字串。 <否則>不會進行格式化。 </ul>

Java 文件 java.util.logging.Formatter.formatMessage(java.util.logging.LogRecord)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於