-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add README.md with simple code example
- Loading branch information
1 parent
3d3a550
commit 783490f
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Systemd | ||
|
||
A simple Swift library to interface with systemd on Linux. | ||
|
||
## Installation | ||
|
||
Add the following dependency to your `Package.swift` file: | ||
|
||
```swift | ||
.package(url: "https://github.com/xtremekforever/swift-systemd.git", from: "0.0.1") | ||
``` | ||
|
||
Then, add it to your target `dependencies` section like this: | ||
|
||
```swift | ||
.product(name: "Systemd", package: "swift-systemd") | ||
``` | ||
|
||
## Usage | ||
|
||
For now, the library only has the ability to see if the app is running under systemd. To do this, | ||
`import Systemd` in your app, then use `SystemdHelpers` to get a true or false value: | ||
|
||
```swift | ||
if SystemdHelpers.isSystemdService { | ||
print("This app is running as a systemd service!") | ||
|
||
// do things like modify logging format (if using swift-log) or whatever else is needed. | ||
} | ||
``` |