Skip to content

Commit bef6bba

Browse files
committed
Update docs
1 parent 35c39ff commit bef6bba

File tree

4 files changed

+36
-12
lines changed

4 files changed

+36
-12
lines changed

Sources/Pulse/LoggerStore/LoggerStore.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,16 @@ public final class LoggerStore: @unchecked Sendable, Identifiable {
101101
/// Initializes the store with the given URL. The store needs to be
102102
///
103103
/// The ``LoggerStore/shared`` store is a package optimized for writing. When
104-
/// you are ready to share the store, create a Pulse document using ``copy(to:predicate:)``
104+
/// you are ready to share the store, create a Pulse document using ``export(to:options:)``
105105
/// method. The document format is optimized to use the least amount of space possible.
106106
///
107107
/// - parameters:
108108
/// - storeURL: The store URL that points to a package (directory)
109109
/// with a Pulse database.
110-
/// - options: By default, empty. To create a store, use ``Options-swift.struct/create``.
110+
/// - options: By default, contains ``LoggerStore/Options-swift.struct/create``
111+
/// and ``LoggerStore/Options-swift.struct/sweep`` options.
111112
/// - configuration: The store configuration specifying size limit, etc.
112-
public init(storeURL: URL, options: Options = [], configuration: Configuration = .init()) throws {
113+
public init(storeURL: URL, options: Options = [.create, .sweep], configuration: Configuration = .init()) throws {
113114
var isDirectory: ObjCBool = ObjCBool(false)
114115
let fileExists = Files.fileExists(atPath: storeURL.path, isDirectory: &isDirectory)
115116
guard (fileExists && isDirectory.boolValue) || options.contains(.create) else {

Sources/Pulse/Pulse.docc/Articles/GettingStarted.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Learn how to integrate Pulse.
1010
https://github.com/kean/Pulse
1111
```
1212

13-
Add both **Pulse** and **PulseUI** libraries to your app. **PulseProxy** is optional and provides a quick, convenient way to capture network traffic to evaluate the framework.
13+
Add **Pulse** and **PulseUI** libraries to your app.
1414

1515
- **Option 2**. Use precompiled binary frameworks from the [latest release](https://github.com/kean/Pulse/releases).
1616

@@ -44,9 +44,9 @@ NetworkLogger.enableProxy()
4444
#endif
4545
```
4646

47-
> note: **PulseProxy** uses method swizzling and private APIs and it is not recommended that you include it in the production builds of your app.
47+
> important: **PulseProxy** uses swizzling and private APIs and it is not recommended that you include it in the production builds of your app.
4848
49-
### 2.2. Collect Regular Messages
49+
### 2.2. Collect Logs
5050

5151
To store regular log messages, use [LoggerStore](https://kean-docs.github.io/pulse/documentation/pulse/loggerstore).
5252

@@ -59,23 +59,23 @@ LoggerStore.shared.storeMessage(
5959
)
6060
```
6161

62-
> info: As an alternative to using `LoggerStore` directly, you can use Pulse as a SwiftLog backend using [PersistentLogHandler](https://kean-docs.github.io/pulseloghandler/documentation/pulseloghandler/persistentloghandler) struct from [PulseLogHandler](https://kean-docs.github.io/pulseloghandler/documentation/pulseloghandler) which is a [Swift package distributed separately](https://github.com/kean/PulseLogHandler). This way you can have more than one logger at once.
63-
64-
Logs are stored persistently and the store automatically removes old messages and limits the overall size (configurable). It uses a number of space [optimizations techniques](https://kean.blog/post/pulse-2#space-savings), including fast [lzfse](https://developer.apple.com/documentation/compression/algorithm/lzfse) compression.
62+
> tip: Alternatively, you can use it as a SwiftLog backend using [PersistentLogHandler](https://kean-docs.github.io/pulseloghandler/documentation/pulseloghandler/persistentloghandler) from a [PulseLogHandler](https://github.com/kean/PulseLogHandler) package.
6563
6664
## 3. Integrate PulseUI Framework
6765

68-
To view logs and network requests from your app, use [PulseUI](https://kean-docs.github.io/pulseui/documentation/pulseui/) framework. The framework is centered around a single screen: `ConsoleView`. On iOS, you can push it into the existing navigation stack or present it modally.
66+
[**PulseUI**](https://kean-docs.github.io/pulseui/documentation/pulseui/) allows you to view logs and network requests directly from your app. The framework is centered around a single screen: `ConsoleView`. On iOS, you can push it into the existing navigation stack or present it modally.
6967

7068
```swift
69+
import PulseUI
70+
7171
NavigationLink(destination: ConsoleView()) {
7272
Text("Console")
7373
}
7474
```
7575

76-
> Note: There are some additional steps required for some platforms. For more information see the PulseUI [documentation](https://kean-docs.github.io/pulseui/documentation/pulseui/).
76+
> tip: For more information, see the PulseUI [documentation](https://kean-docs.github.io/pulseui/documentation/pulseui/).
7777
78-
## 4. Configure Remote Logging with Pulse Pro
78+
## 4. Get Pulse Pro
7979

8080
In addition to the frameworks and the on-device view, Pulse also provides a separate professional macOS app called [Pulse Pro](https://kean.blog/pulse/pro) that you can use for viewing the previously shared logs or even viewing the logs from the device remotely in real-time.
8181

@@ -103,3 +103,7 @@ Open the Pulse console from the app, go to Settings, enable "Remote Logging", an
103103
![Enabling remote logging](remote-logging.png)
104104

105105
Once the connection is established, open Pulse Pro and select the device in the sidebar. The next time you launch the app, the connection will happen automatically.
106+
107+
## Next Steps
108+
109+
Learn how to configure Pulse to best suit your app needs in <doc:NextSteps> and explore additional networking debugging techniques in <doc:NetworkLogging-Article>.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Next Steps
2+
3+
Learn how to configure Pulse to best suit your app needs.
4+
5+
## Logger
6+
7+
### Configure Store
8+
9+
``LoggerStore`` is the primary way to configure how logs are stored. It uses a database to record logs in an efficient binary format and employes a number of space [optimizations techniques](https://kean.blog/post/pulse-2#space-savings), including fast [lzfse](https://developer.apple.com/documentation/compression/algorithm/lzfse) compression. The store automatically limits how much spaces it takes and also removed old logs.
10+
11+
You can configure the logger be replacing the default store.
12+
13+
```swift
14+
var configuration = LoggerStore.Configuration()
15+
configuration.sizeLimit = 512 * 1_000_000
16+
17+
LoggerStore.shared = try LoggerStore(storeURL: <#storeURL#>, configuration: configration)
18+
```

Sources/Pulse/Pulse.docc/Pulse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Logger and network inspector for Apple platforms.
77
### Essentials
88

99
- <doc:GettingStarted>
10+
- <doc:NextSteps>
1011
- ``LoggerStore``
1112

1213
### Network Logging

0 commit comments

Comments
 (0)