Skip to content

Protocol

LoggerFragment

A fragment of a log message.
protocol LoggerFragment : Sendable

Mentioned in

Topics

Instance Methods

  • and(_:)
    Combine the current fragment with another, which will be written after the current fragment finishes.
  • hasContent(record:)
    Indicates whether the fragment will write anything to output when write(_:to:) is called.
  • maxLevel(_:)
    Make the current fragment conditional, only calling its output method if the record’s loggerLevel is maxLevel or lower
  • prefixed(_:)
    Add a literal prefix to the current fragment.
  • separated(_:)
    Appends the given separator text to the output before self’s output, as long as a separator is needed.
  • suffixed(_:)
    Add a literal suffix to the current fragment.
  • write(_:to:)
    Add this fragment’s output to the console text.

Type Properties

Type Methods

Relationships

Inherits From

  • Swift.Sendable
  • Swift.SendableMetatype

Conforming Types

See Also

Logger Fragments

  • LoggerFragmentBuilder
    A result builder for creating logger fragments in a declarative way.
  • FragmentOutput
    The output of a LoggerFragment, including some intermediary state used for things like deduplicating separators.
  • IfMaxLevelFragment
    Make the current fragment conditional, only calling its output method if the record’s loggerLevel is maxLevel or lower
  • AndFragment
    Combine the current fragment with another, which will be written after the current fragment finishes.
  • OptionalFragment
    A fragment that conditionally includes another fragment.
  • ArrayFragment
    A fragment that combines multiple fragments of the same type.
  • LabelFragment
    Writes the label of the logger, and requests a separator for the next fragment.
  • LevelFragment
    Writes the level of the logged message, and requests a separator for the next fragment.
  • LiteralFragment
    Writes the given text to the output.
  • SeparatorFragment
  • SpacedFragment
    A fragment that wraps another fragment, automatically separating its components with spaces.
  • MessageFragment
    Writes the logged message to the output, and requests a separator for the next fragment.
  • MetadataFragment
    Writes the combined metadata to the output, and requests a separator for the next fragment only if the metadata was not empty.
  • SourceLocationFragment
    Writes the file location of the logged message, including the line.
  • LoggerSourceFragment
    Writes the source of the logged message.