Logger

public protocol Logger

The contract for logging service. All logging service providers must conform to this protocol.

Debug

  • Logs a developer-formatted message using the .debug type.

    The caller is responsible for including public/private formatting in the format string, as well as any source location info (line number, etc.).

    Declaration

    Swift

    @inlinable
    func logDebug(format: StaticString, args: CVarArg...)

    Parameters

    format

    A C-style format string.

    args

    A list of arguments to the format string (if any).

  • logDebug(_:file:function:line:) Default implementation

    Logs a message using the .debug type.

    Default Implementation

    Logs a message using the .debug type.

    Declaration

    Swift

    @inlinable
    func logDebug(_ value: Any, file: String, function: String, line: UInt)

    Parameters

    value

    The value to be logged. If the value does not already conform to CustomLogRepresentable, a default implementation will used.

  • Logs the source location of the call site using the .debug type.

    Declaration

    Swift

    @inlinable
    func trace(file: String, function: String, line: UInt)

Info

  • Logs a developer-formatted message using the .info type.

    The caller is responsible for including public/private formatting in the format string, as well as any source location info (line number, etc.).

    Declaration

    Swift

    @inlinable
    func logInfo(format: StaticString, args: CVarArg...)

    Parameters

    format

    A C-style format string.

    args

    A list of arguments to the format string (if any).

  • logInfo(_:file:function:line:) Default implementation

    Logs a message using the .info type.

    Default Implementation

    Logs a message using the .info type.

    Declaration

    Swift

    @inlinable
    func logInfo(_ value: Any, file: String, function: String, line: UInt)

    Parameters

    value

    The value to be logged. If the value does not already conform to CustomLogRepresentable, a default implementation will used.

Default

  • Logs a developer-formatted message using the .default type.

    The caller is responsible for including public/private formatting in the format string, as well as any source location info (line number, etc.).

    Declaration

    Swift

    @inlinable
    func log(format: StaticString, args: CVarArg...)

    Parameters

    format

    A C-style format string.

    args

    A list of arguments to the format string (if any).

  • log(_:file:function:line:) Default implementation

    Logs a message using the .default type.

    Default Implementation

    Logs a message using the .default type.

    Declaration

    Swift

    @inlinable
    func log(_ value: Any, file: String, function: String, line: UInt)

    Parameters

    value

    The value to be logged. If the value does not already conform to CustomLogRepresentable, a default implementation will used.

Error

  • Logs a developer-formatted message using the .error type.

    The caller is responsible for including public/private formatting in the format string, as well as any source location info (line number, etc.).

    Declaration

    Swift

    @inlinable
    func logError(format: StaticString, args: CVarArg...)

    Parameters

    format

    A C-style format string.

    args

    A list of arguments to the format string (if any).

  • logError(_:file:function:line:) Default implementation

    Logs a message using the .error type.

    Default Implementation

    Logs a message using the .error type.

    Declaration

    Swift

    @inlinable
    func logError(_ value: Any, file: String, function: String, line: UInt)

    Parameters

    value

    The value to be logged. If the value does not already conform to CustomLogRepresentable, a default implementation will used.

Fault

  • Logs a developer-formatted message using the .fault type.

    The caller is responsible for including public/private formatting in the format string, as well as any source location info (line number, etc.).

    Declaration

    Swift

    @inlinable
    func logFault(format: StaticString, args: CVarArg...)

    Parameters

    format

    A C-style format string.

    args

    A list of arguments to the format string (if any).

  • logFault(_:file:function:line:) Default implementation

    Logs a message using the .fault type.

    Default Implementation

    Logs a message using the .fault type.

    Declaration

    Swift

    @inlinable
    func logFault(_ value: Any, file: String, function: String, line: UInt)

    Parameters

    value

    The value to be logged. If the value does not already conform to CustomLogRepresentable, a default implementation will used.