Skip to content

class ConsoleFormatterOptions

cangjie
public open class ConsoleFormatterOptions <: IConfigurationBinding

功能:表示控制台格式化器的基础选项。

父类型:

成员概览

成员功能
var timestampFormat获取或设置日志时间戳格式。
var useUtcTimestamp获取或设置是否使用 UTC 时间戳。
func configure(IConfiguration)使用配置源绑定当前选项。
func bind(String, Any)按成员名写入绑定值。

var timestampFormat

cangjie
public var timestampFormat: ?String = None

功能:获取或设置日志时间戳格式。

类型:?String

var useUtcTimestamp

cangjie
public var useUtcTimestamp: Bool = false

功能:获取或设置是否使用 UTC 时间戳。

类型:Bool

func configure(IConfiguration)

cangjie
public open func configure(configuration: IConfiguration): Unit

功能:使用配置源绑定当前选项。

参数:

返回值:

  • Unit

func bind(String, Any)

cangjie
public open func bind(name: String, value: Any): Unit

功能:按成员名写入绑定值。

参数:

  • name: String - 目标成员名。
  • value: Any - 已完成类型转换的绑定值。

返回值:

  • Unit