TopicPath

public struct TopicPath : Hashable, CustomStringConvertible, ExpressibleByArrayLiteral

An abstract path for log events.

This is used to provide a simple hierarchical structure to log events to facilitate filtering and collapsing, mostly by Features but also arbitrary paths for non-Feature based subsystems.

  • Undocumented

    Declaration

    Swift

    public let path: [String]
  • Declaration

    Swift

    public let description: String
  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)
  • Initialise the path with an array of strings, e.g. ["UI", "Search"] or ["Network", "JSON Cache"]

    Declaration

    Swift

    public init(_ path: [String])
  • A convenience initialiser to permit assigning topic paths from array literals e.g.: let topicToFocus: TopicPath = ["UI", "Search"]

    Declaration

    Swift

    public init(arrayLiteral elements: String...)
    • return: A new topic path with the specified string appended to the end of the path as a new node

    Declaration

    Swift

    public func appending(_ topic: String) -> TopicPath
    • return: true if other is prefixed with the same path elements as this topic path

    Declaration

    Swift

    public func matches(_ other: TopicPath) -> Bool
    • return: A new topic path pointing to the immediate parent of this path, or nil if this path has only one node.

    Declaration

    Swift

    public func parentPath() -> TopicPath?