Functions
The following functions are available globally.
-
A public global function that formats and prints a message to the console corresponding to data stored as JSON for a given print number and behaves as an analogue overload of the Swift
print(_:separator:terminator:)function.Declaration
Swift
@available(macOS 11.2, iOS 15.2, watchOS 8.3, tvOS 15.2, *) public func print(_ printNumber: Int, functionName: String? = nil, settings: SettingsManagerService? = nil)Parameters
printNumberAn
Intthat acts as a unique number used as a key to access a specific associated message from a dictionary containing all message data.functionNameAn optional parameter for a
#functionmacro argument. If this parameter is includedClarityformats and prints the log as a function name node for the function that containsprintNumber(see doc:Output-called-function-names).settingsAn optional parameter for a dynamic
SettingsManagerServiceinstance. TheSettingsManagerServiceinstance can have its properties set programmatically to a variety of values. This enables more convenient and dynamic evaluation of a wider range of unit tests in a test target than is possible when using the JSON access mechanism. -
A public global function that formats and prints a message to the console corresponding to data stored as JSON for a given print number and behaves as an analogue overload of the Swift
print(_:separator:terminator:)function.Declaration
Swift
@available(macOS 11.2, iOS 15.2, watchOS 8.3, tvOS 15.2, *) public func print(_ printNumber: Int, values: Any? = nil, settings: SettingsManagerService? = nil)Parameters
printNumberAn
Intthat acts as a unique number used as a key to access a specific associated message from a dictionary containing all message data.valuesAn optional parameter for the inclusion of variable values to be printed as part of the message. If this parameter is included
Clarityformats and prints the log as a value report node (see doc:Output-values-and-errors). The parameter can be a single value of any type, aCollectionof any type or an instance conforming to theErrorprotocol.settingsAn optional parameter for a dynamic
SettingsManagerServiceinstance. TheSettingsManagerServiceinstance can have its properties set programmatically to a variety of values. This enables more convenient and dynamic evaluation of a wider range of unit tests in a test target than is possible when using the JSON access mechanism.
Functions Reference