Skip to content

Commit 4121d24

Browse files
heckjczechboy0FranzBusch
authored
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>
1 parent a90a3d1 commit 4121d24

17 files changed

+832
-381
lines changed

Snippets/basic-usage.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Import the logging API
2+
import Logging
3+
4+
// Create a logger with a label
5+
let logger = Logger(label: "MyLogger")
6+
7+
// Use it to log messages
8+
logger.info("Hello World!")

Sources/Logging/Docs.docc/ImplementingALogHandler.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# Implementing a log handler
22

3-
Create a custom logging backend that provides logging services for your apps
4-
and libraries.
3+
Create a custom logging backend that provides logging services for your apps and libraries.
54

65
## Overview
76

8-
To become a compatible logging backend that any `SwiftLog` consumer can use,
7+
To become a compatible logging backend that any SwiftLog consumer can use,
98
you need to fulfill a few requirements, primarily conforming to the
109
``LogHandler`` protocol.
1110

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ``Logging/LogHandler``
2+
3+
## Topics
4+
5+
### Sending log messages
6+
7+
- ``log(level:message:metadata:source:file:function:line:)-8kgt7``
8+
- ``log(level:message:metadata:source:file:function:line:)-69pez``
9+
- ``log(level:message:metadata:file:function:line:)-89rya``
10+
- ``log(level:message:metadata:file:function:line:)-1xdau``
11+
12+
### Updating metadata
13+
14+
- ``subscript(metadataKey:)``
15+
16+
### Inspecting a log handler
17+
18+
- ``logLevel``
19+
- ``metadata``
20+
- ``metadataProvider``
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ``Logging/Logger/Level``
2+
3+
## Topics
4+
5+
### Log Levels
6+
7+
- ``trace``
8+
- ``debug``
9+
- ``info``
10+
- ``notice``
11+
- ``warning``
12+
- ``error``
13+
- ``critical``
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ``Logging/Logger/Message``
2+
3+
## Topics
4+
5+
### Creating a log message
6+
7+
- ``init(stringLiteral:)``
8+
9+
### Inspecting a log message
10+
11+
- ``description``
12+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ``Logging/Logger/MetadataProvider``
2+
3+
## Topics
4+
5+
### Creating a metadata provider
6+
7+
- ``init(_:)``
8+
9+
### Invoking the provider
10+
11+
- ``get()``
12+
13+
### Merging metadata
14+
15+
- ``multiplex(_:)``
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ``Logging/Logger/MetadataValue``
2+
3+
## Topics
4+
5+
### Types of metadata values
6+
7+
- ``string(_:)``
8+
- ``stringConvertible(_:)``
9+
- ``array(_:)``
10+
- ``dictionary(_:)``
11+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# ``Logging/Logger``
2+
3+
## Topics
4+
5+
### Creating Loggers
6+
7+
- ``init(label:)``
8+
- ``init(label:metadataProvider:)``
9+
- ``init(label:factory:)-9uiy2``
10+
- ``init(label:factory:)-6iktu``
11+
- ``MetadataProvider``
12+
13+
### Sending trace log messages
14+
15+
- ``trace(_:metadata:file:function:line:)``
16+
- ``trace(_:metadata:source:file:function:line:)``
17+
18+
### Sending debug log messages
19+
- ``debug(_:metadata:file:function:line:)``
20+
- ``debug(_:metadata:source:file:function:line:)``
21+
22+
### Sending info log messages
23+
- ``info(_:metadata:file:function:line:)``
24+
- ``info(_:metadata:source:file:function:line:)``
25+
26+
### Sending notice log messages
27+
- ``notice(_:metadata:file:function:line:)``
28+
- ``notice(_:metadata:source:file:function:line:)``
29+
30+
### Sending warning log messages
31+
- ``warning(_:metadata:file:function:line:)``
32+
- ``warning(_:metadata:source:file:function:line:)``
33+
34+
### Sending error log messages
35+
- ``error(_:metadata:file:function:line:)``
36+
- ``error(_:metadata:source:file:function:line:)``
37+
38+
### Sending critical log messages
39+
- ``critical(_:metadata:file:function:line:)``
40+
- ``critical(_:metadata:source:file:function:line:)``
41+
42+
### Sending general log messages
43+
44+
- ``log(level:_:metadata:file:function:line:)``
45+
- ``log(level:_:metadata:source:file:function:line:)``
46+
- ``Level``
47+
- ``Message``
48+
- ``Metadata``
49+
50+
### Adjusting logger metadata
51+
52+
- ``subscript(metadataKey:)``
53+
- ``MetadataValue``
54+
55+
### Inspecting a logger
56+
57+
- ``label``
58+
- ``logLevel``
59+
- ``handler``
60+
- ``metadataProvider``
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ``Logging/LoggingSystem``
2+
3+
## Topics
4+
5+
### Initializing the logging system
6+
7+
- ``bootstrap(_:)``
8+
- ``bootstrap(_:metadataProvider:)``
9+
10+
### Inspecting the logging system
11+
12+
- ``metadataProvider``
13+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# ``Logging/MultiplexLogHandler``
2+
3+
## Topics
4+
5+
### Creating a multiplex log handler
6+
7+
- ``init(_:)``
8+
- ``init(_:metadataProvider:)``
9+
10+
### Sending log messages
11+
12+
- ``log(level:message:metadata:source:file:function:line:)``
13+
14+
### Updating metadata
15+
16+
- ``subscript(metadataKey:)``
17+
18+
### Inspecting a log handler
19+
20+
- ``logLevel``
21+
- ``metadata``
22+
- ``metadataProvider``

0 commit comments

Comments
 (0)