<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Combine",
  "identifier" : "/documentation/Combine/Publishers/Print",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine10PublishersO5PrintV"
  },
  "title" : "Publishers.Print"
}
-->

# Publishers.Print

A publisher that prints log messages for all publishing events, optionally prefixed with a given string.

```
struct Print<Upstream> where Upstream : Publisher
```

## Overview

This publisher prints log messages when receiving the following events:

- subscription
- value
- normal completion
- failure
- cancellation

## Topics

### Creating a print publisher

[`init(upstream:prefix:to:)`](/documentation/Combine/Publishers/Print/init(upstream:prefix:to:))

Creates a publisher that prints log messages for all publishing events.

### Declaring supporting types

[`Publishers.Print.Output`](/documentation/Combine/Publishers/Print/Output)

The kind of values published by this publisher.

[`Publishers.Print.Failure`](/documentation/Combine/Publishers/Print/Failure)

The kind of errors this publisher might publish.

### Inspecting publisher properties

[`upstream`](/documentation/Combine/Publishers/Print/upstream)

The publisher from which this publisher receives elements.

[`prefix`](/documentation/Combine/Publishers/Print/prefix)

A string with which to prefix all log messages.

[`stream`](/documentation/Combine/Publishers/Print/stream)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)