LXLogger

public final class LXLogger

The main logging API for application code. An instance of this class distributes Log Entries to Endpoints for writing.

  • Initialize a Logger. Any Endpoints that fail initialization are discarded.

    Declaration

    Swift

    public init(endpoints: [LXEndpoint?])

    Parameters

    endpoints

    An array of Endpoints to dispatch Log Entries to.

  • Initialize a basic Logger that writes to the console (stderr) with default settings.

    Declaration

    Swift

    public convenience init()
  • Log a Debug entry.

    Declaration

    Swift

    public func debug(
            @autoclosure(escaping) message: () -> String,
            userInfo: [String: AnyObject] = [:],
            functionName: String = #function,
            filePath: String = #file,
            lineNumber: Int = #line,
            columnNumber: Int = #column
        )

    Parameters

    message

    The message to log.

    userInfo

    A dictionary of additional values for Endpoints to consider.

  • Log an Info entry.

    Declaration

    Swift

    public func info(
            @autoclosure(escaping) message: () -> String,
            userInfo: [String: AnyObject] = [:],
            functionName: String = #function,
            filePath: String = #file,
            lineNumber: Int = #line,
            columnNumber: Int = #column
        )

    Parameters

    message

    The message to log.

    userInfo

    A dictionary of additional values for Endpoints to consider.

  • Log a Notice entry.

    Declaration

    Swift

    public func notice(
            @autoclosure(escaping) message: () -> String,
            userInfo: [String: AnyObject] = [:],
            functionName: String = #function,
            filePath: String = #file,
            lineNumber: Int = #line,
            columnNumber: Int = #column
        )

    Parameters

    message

    The message to log.

    userInfo

    A dictionary of additional values for Endpoints to consider.

  • Log a Warning entry.

    Declaration

    Swift

    public func warning(
            @autoclosure(escaping) message: () -> String,
            userInfo: [String: AnyObject] = [:],
            functionName: String = #function,
            filePath: String = #file,
            lineNumber: Int = #line,
            columnNumber: Int = #column
        )

    Parameters

    message

    The message to log.

    userInfo

    A dictionary of additional values for Endpoints to consider.

  • Log an Error entry.

    Declaration

    Swift

    public func error(
            @autoclosure(escaping) message: () -> String,
            userInfo: [String: AnyObject] = [:],
            functionName: String = #function,
            filePath: String = #file,
            lineNumber: Int = #line,
            columnNumber: Int = #column
        )

    Parameters

    message

    The message to log.

    userInfo

    A dictionary of additional values for Endpoints to consider.

  • Log a Critical entry.

    Declaration

    Swift

    public func critical(
            @autoclosure(escaping) message: () -> String,
            userInfo: [String: AnyObject] = [:],
            functionName: String = #function,
            filePath: String = #file,
            lineNumber: Int = #line,
            columnNumber: Int = #column
        )

    Parameters

    message

    The message to log.

    userInfo

    A dictionary of additional values for Endpoints to consider.