Publisher
extension Publisher
-
Publisher which logs the failure value of the preceding publisher
Declaration
Swift
public func logError( logCategory: KeyPath<LogCategories, LogCategory> = \.default, functionName: StaticString = #function, fileName: StaticString = #file, lineNumber: Int = #line, _ message: @escaping (Self.Failure) -> Any? = { (output: Self.Failure) in return output } ) -> AnyPublisher<Self.Output, Self.Failure>Parameters
logCategoryCategory of the log message
functionNameName of the function in which the message is logged
fileNameName of the file in which the message is logged
lineNumberLine number in which the message is logged
messageMessage to log
Return Value
Returns an AnyPublisher with
AnyPublisher<Self.Output, Self.Failure> -
Publisher which logs the ouput value of the preceding publisher
Declaration
Swift
public func logValue(logType: LogType = .verbose, logCategory: KeyPath<LogCategories, LogCategory> = \.default, functionName: StaticString = #function, fileName: StaticString = #file, lineNumber: Int = #line, _ message: @escaping (Self.Output) -> Any? = { (output: Self.Output) in return output } ) -> AnyPublisher<Self.Output, Self.Failure>Parameters
logTypeType of the value log message
logCategoryCategory of the log message
functionNameName of the function in which the message is logged
fileNameName of the file in which the message is logged
lineNumberLine number in which the message is logged
messageMessage to log
Return Value
Returns an AnyPublisher with
AnyPublisher<Self.Output, Self.Failure> -
Publisher which both logs the Self.Failure value and the Self.Output value of the preceding publisher
Declaration
Swift
public func log( messageValue: @escaping (Self.Output) -> Any? = { (output: Self.Output) in return output }, messageError: @escaping (Self.Failure) -> Any? = { (output: Self.Failure) in return output }, valuelogType: LogType = .verbose, logCategory: KeyPath<LogCategories, LogCategory> = \.default, functionName: StaticString = #function, fileName: StaticString = #file, lineNumber: Int = #line) -> AnyPublisher<Self.Output, Self.Failure>Parameters
messageValueSelf.Output message to log
messageErrorSelf.Failure message to log
valuelogTypeType of the Self.Output log message
logCategoryCategory of the both log messages
functionNameName of the function in which the message is logged
fileNameName of the file in which the message is logged
lineNumberLine number in which the message is logged
Return Value
Returns an AnyPublisher with
AnyPublisher<Self.Output, Self.Failure>
Publisher Extension Reference