String

struct String
  • Creates ‘source’ information from a #file identifier.

    Example usage: log.atLevelDebug(id: 0, source: #file.source(#function, #line), message: My Message)

    Note

    This will increase the time needed to create the log entry, it is therefore not advised for time-critical entries. Suggested use is at level NOTICE and above only.

    Declaration

    Swift

    public func source(_ function: String, _ line: Int) -> String

    Parameters

    function

    A string identifying the function that the logging information is created in.

    line

    The line number where the logging call is made.

    Return Value

    A string to be used as the ‘source’ identifier in the logging message.