Skip to content

Commit 3eca9a6

Browse files
authored
Merge pull request #2 from ktoso/patch-1
Cross link to swift-log and colorize snippets
2 parents ce0e52d + 0d7d702 commit 3eca9a6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# swift-log-file
22

3+
[SwiftLog](https://github.com/apple/swift-log) compatible file log handler.
4+
35
## Example: Just logging to a file
46

5-
```
7+
```swift
68
let logFileURL = URL(/* your local log file here */)
79
let logger = try FileLogHandler.fileLogger(label: "Foobar", localFile: logFileURL)
810

@@ -11,7 +13,7 @@ logger.error("Test Test Test")
1113

1214
## Example: Logging to both the standard output (Xcode console if using Xcode) and a file.
1315

14-
```
16+
```swift
1517
let logFileURL = try getDocumentsDirectory().appendingPathComponent(logFileName)
1618

1719
LoggingSystem.bootstrap { label in
@@ -31,4 +33,4 @@ let logger = Logger(label: "Test")
3133

3234
Note in that last example, if you use `LoggingSystem.bootstrap`, make sure to create your `Logger` *after* the `LoggingSystem.bootstrap` usage (or you won't get the effects of the `LoggingSystem.bootstrap`).
3335

34-
For more examples, see the unit tests.
36+
For more examples, see the unit tests and refer to [apple/swift-log's README](https://github.com/apple/swift-log#the-core-concepts)

0 commit comments

Comments
 (0)