Formatter.FormatMessage(LogRecord) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
本地化和格式化来自日志记录的消息字符串。
[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
包含原始消息的日志记录
返回
本地化和格式化的消息
- 属性
注解
本地化和格式化来自日志记录的消息字符串。 此方法作为格式化程序子类在执行格式设置时使用的便利性提供。
消息字符串首先使用记录的 ResourceBundle 本地化为格式字符串。 (如果没有 ResourceBundle,或者找不到消息键,则将密钥用作格式字符串。格式字符串使用 java.text 样式格式。 <ul><li>如果没有参数,则不使用格式化程序。 <li>否则,如果字符串包含“{0”,则 java.text.MessageFormat 用于设置字符串的格式。 <li>否则不执行任何格式设置。 </ul>
适用于 . 的 java.util.logging.Formatter.formatMessage(java.util.logging.LogRecord)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。