public final class LogFields:
Immutable snapshot of structured fields attached to a log event.
Input maps are copied on construction and toMap() returns another copy, so field membership cannot be changed through an emitted event. Referenced object values retain their own mutability semantics.
import klyn.logging
fields = LogFields({"requestId": "req-42"})
assert fields["requestId"] == "req-42"| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | sizesize as ULong: |
Number of structured fields. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | LogFields | Creates an immutable field snapshot. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | items | Returns an immutable snapshot of field entries. |
| public | keys | Returns field names. |
| public static | merge | Merges two maps, giving explicit fields precedence over context fields. |
| public | toMap | Returns a mutable copy of the fields. |
| public override | toStringtoString() as String: |
Returns a readable map representation. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | operator in(name as String) as Boolean: | Tests whether a field exists. |
| public | operator[](name as String) as Object: | Reads a field. |