Files
swift-log/Sources/Logging/Docs.docc/Reference/Logger.md
T
4121d24dbd documentation update and re-organization (#381)
Provide organization (aka curation) and abstracts for all of the public
types in the library.

### Motivation:

Updates to the documentation to fill in the missing abstracts for the
provided types, updating the language to follow Apple developer content
guidelines, and fixing smaller typos and grammar issues.

### Modifications:

Curation files added to provide organization for public types, ordering
the content to align with the narrative content provided earlier.
Updating API comments, adding abstracts and parameters where missing,
and moving some of the getting started content that was previously in
the main index into a separate article.

### Result:

starting point

```
   --- Experimental coverage output enabled. ---
                | Abstract        | Curated         | Code Listing
Types           | 69% (11/16)     | 38% (6/16)      | 25% (4/16)
Members         | 57% (54/94)     | 3.2% (3/94)     | 0.0% (0/94)
Globals         | 7.1% (1/14)     | 7.1% (1/14)     | 7.1% (1/14)
```

Updated:

```
                | Abstract        | Curated         | Code Listing
Types           | 94% (15/16)     | 94% (15/16)     | 38% (6/16)
Members         | 85% (80/94)     | 97% (91/94)     | 0.0% (0/94)
Globals         | 14% (2/14)      | 100% (14/14)    | 7.1% (1/14)
```

---------

Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Franz Busch <privat@franz-busch.de>
2025-11-03 11:26:54 -08:00

1.4 KiB

Logging/Logger

Topics

Creating Loggers

  • init(label:)
  • init(label:metadataProvider:)
  • init(label:factory:)-9uiy2
  • init(label:factory:)-6iktu
  • MetadataProvider

Sending trace log messages

  • trace(_:metadata:file:function:line:)
  • trace(_:metadata:source:file:function:line:)

Sending debug log messages

  • debug(_:metadata:file:function:line:)
  • debug(_:metadata:source:file:function:line:)

Sending info log messages

  • info(_:metadata:file:function:line:)
  • info(_:metadata:source:file:function:line:)

Sending notice log messages

  • notice(_:metadata:file:function:line:)
  • notice(_:metadata:source:file:function:line:)

Sending warning log messages

  • warning(_:metadata:file:function:line:)
  • warning(_:metadata:source:file:function:line:)

Sending error log messages

  • error(_:metadata:file:function:line:)
  • error(_:metadata:source:file:function:line:)

Sending critical log messages

  • critical(_:metadata:file:function:line:)
  • critical(_:metadata:source:file:function:line:)

Sending general log messages

  • log(level:_:metadata:file:function:line:)
  • log(level:_:metadata:source:file:function:line:)
  • Level
  • Message
  • Metadata

Adjusting logger metadata

  • subscript(metadataKey:)
  • MetadataValue

Inspecting a logger

  • label
  • logLevel
  • handler
  • metadataProvider