LXConsoleEndpoint

public class LXConsoleEndpoint: LXEndpoint

An Endpoint that prints Log Entries to the console (stderr) in either a synchronous or asynchronous fashion.

  • The minimum Priority Level a Log Entry must meet to be accepted by this Endpoint.

    Declaration

    Swift

    public var minimumPriorityLevel: LXPriorityLevel
  • The formatter used by this Endpoint to serialize a Log Entry’s dateTime property to a string.

    Declaration

    Swift

    public var dateFormatter: LXDateFormatter
  • The formatter used by this Endpoint to serialize each Log Entry to a string.

    Declaration

    Swift

    public var entryFormatter: LXEntryFormatter
  • This Endpoint requires a newline character appended to each serialized Log Entry string.

    Declaration

    Swift

    public let requiresNewlines: Bool = true
  • Initialize a Console Endpoint.

    A synchronous Console Endpoint will write each Entry to the console before continuing with application execution, which makes debugging much easier. An asynchronous Console Endpoint may continue execution before every Entry is written to the console, which will improve performance.

    Declaration

    Swift

    public init(
            synchronous: Bool = true,
            minimumPriorityLevel: LXPriorityLevel = .All,
            dateFormatter: LXDateFormatter = LXDateFormatter.standardFormatter(),
            entryFormatter: LXEntryFormatter = LXEntryFormatter.standardFormatter()
        )

    Parameters

    synchronous

    Indicates whether the application should wait for each Entry to be printed to the console before continuing execution. Defaults to true.

    minimumPriorityLevel

    The minimum Priority Level a Log Entry must meet to be accepted by this Endpoint. Defaults to .All.

    dateFormatter

    The formatter used by this Endpoint to serialize a Log Entry’s dateTime property to a string. Defaults to .standardFormatter().

    entryFormatter

    The formatter used by this Endpoint to serialize each Log Entry to a string. Defaults to .standardFormatter().

  • Writes a serialized Log Entry string to the console (stderr).

    Declaration

    Swift

    public func write(string: String)