FlintLoggable

public protocol FlintLoggable

The protocol to which Inputs must conform to be logged usefully by Flint’s logging, Timeline, Action Stacks etc.

Flint requires a human readable description of all inputs to use in logs and debug UI, as well as a structured data representation for use in machine-readable outputs.

We cannot rely on CustomStringConvertible and CustomDebugStringConvertible for this as the developer may not control the contents of these, and the semantics are not rigid enough for our use.

  • loggingDescription Default implementation

    Must return a human-readable description the type for use in logs and debug UI

    Default Implementation

    By default use debugDescription if it is supported, if not fall back to debug description. It is much better to provide a meaningful implementation on your own types

    Declaration

    Swift

    var loggingDescription: String { get }
  • loggingInfo Default implementation

    Must return a machine-readable set of properties describing the type, for use in exported reports for later structure analysis or querying. !!! TODO: How should we handle this in terms of performance, memory and nesting? Just a flat chunk of data for now

    Default Implementation

    Declaration

    Swift

    var loggingInfo: [String : String]? { get }