LogHandlerConfiguration
classin packageklyn.logging
public final class LogHandlerConfiguration
LogHandlerConfiguration

Typed view over one handler table loaded from TOML.

Example
import klyn.logging

config = LogHandlerConfiguration("console", {"enabled": true})
assert config.enabled
Properties
Modifier and Type Member Description
public readonly property enabled
enabled as Boolean
Whether this handler is enabled.
public readonly property name
name as String
TOML table name and handler factory identifier.
Constructors
Modifier and Type Member Description
public LogHandlerConfiguration
LogHandlerConfiguration(name as String, options as Map<String, Object> = null)
Creates a handler configuration.
Methods
Modifier and Type Member Description
public boolean
boolean(name as String, defaultValue as Boolean = false) as Boolean
Reads a boolean option.
public has
has(name as String) as Boolean
Tests whether an option exists.
public integer
integer(name as String, defaultValue as Int = 0) as Int
Reads an integer option.
public long
long(name as String, defaultValue as Long = 0l) as Long
Reads a long integer option.
public requiredString
requiredString(name as String) as String
Reads a required non-empty string option.
public string
string(name as String, defaultValue as String = "") as String
Reads a string option.
public table
table(name as String) as SortedMap<String, Object>
Reads a nested TOML table.
public override toMap
toMap() as SortedMap<String, Object>
Returns an independent option map.
public validateOptions
validateOptions(allowed as IList<String>) as Void throws LogConfigurationException
Rejects options not declared by a handler factory.
public value
value(name as String, defaultValue as Object = null) as Object
Reads a raw option.