Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogChannelLocation 2.0 #17

Open
wants to merge 7 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Swift

on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]

Expand Down
165 changes: 0 additions & 165 deletions LICENSE-GENERAL.txt

This file was deleted.

20 changes: 0 additions & 20 deletions LICENSE-SPECIAL.txt

This file was deleted.

24 changes: 17 additions & 7 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
This repository uses multiple licenses. To determine which license is
appropriate, use the following guidance:
Copyright 2022 Ky Leggiero

1. The following entities may use the license provided in the
LICENSE-SPECIAL.txt file in this repository:
a. PKWARE, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

2. All other entities must use the license provided in the LICENSE-GENERAL.txt
file in this repository.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 0 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ let package = Package(
.library(
name: "SimpleLogging",
targets: ["SimpleLogging"]),

// DEPRECATED: Does not play nice with App Store requirements
.library(
name: "SimpleLogging_dynamic",
type: .dynamic,
targets: ["SimpleLogging"]),

.library(
name: "SimpleLoggingDynamic",
type: .dynamic,
targets: ["SimpleLogging"]),
],

dependencies: [
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ log(debug: "TODO: Implement startup procedure")
log(info: "Startup done")
log(warning: "Future versions won't support the `--magically-work` flag")

if username == "BenLeggiero" {
if username == "KyLeggiero" {
log(error: "You aren't allowed in here")
return
}
Expand Down Expand Up @@ -72,13 +72,13 @@ By default, severities are represented by emoji (like ℹ️ for `info` and 🆘

By default, this just logs to the same place as Swift's `print` statement. Because enterprise apps have different needs, it can also log to `stdout`, `stderr`, any `FileHandle`, or a custom function. Arbitrarily many of these can operate simultaneously. You can also specify this per-log-call or for all log calls.

**If none is specified, the default channel filter discards messages lower than `info` severity**, since that's the lowest built-in severity which users might care about if they're looking at the logs, but not debugging the code itself.
**If none is specified, the default channel filter discards messages lower than a severity which users might care about** if they're looking at the logs, but not debugging the code itself.

```swift
LogManager.defaultChannels += [
try LogChannel(name: "General Log File", location: .file(path: "/tmp/com.acme.AwesomeApp/general.log")),
try LogChannel(name: "Debug Log File", location: .file(path: "/tmp/com.acme.AwesomeApp/debug.log"), lowestAllowedSeverity: .debug),
try LogChannel(name: "Error Log File", location: .file(path: "/tmp/com.acme.AwesomeApp/errors.log"), lowestAllowedSeverity: .error, logSeverityNameStyle: .short),
try LogChannel.file(atPath: "/tmp/com.acme.AwesomeApp/general.log"), name: "General Log File"),
try LogChannel.file(atPath: "/tmp/com.acme.AwesomeApp/debug.log"), name: "Debug Log File", lowestAllowedSeverity: .debug),
try LogChannel.file(atPath: "/tmp/com.acme.AwesomeApp/errors.log"), name: "Error Log File", lowestAllowedSeverity: .error, logSeverityNameStyle: .short),
]
```

Expand Down
3 changes: 1 addition & 2 deletions Sources/SimpleLogging/CombinedLogMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// CombinedLogMessage.swift
// SimpleLogging
//
// Created by Ben Leggiero on 2020-07-22.
// Copyright © 2020 Ben Leggiero BH-1-PS
// Created by Ky Leggiero on 2020-07-22.
//

import Foundation
Expand Down
5 changes: 2 additions & 3 deletions Sources/SimpleLogging/CombinedLoggable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
// CombinedLogMessage.swift
// SimpleLogging
//
// Created by Ben Leggiero on 2020-07-22.
// Copyright © 2020 Ben Leggiero BH-1-PS
// Created by Ky Leggiero on 2020-07-22.
//

import Foundation
import LazyContainers



/// Two lazily-combined loggables
/// Two lazily-combined ``Loggable``s
@usableFromInline
internal struct CombinedLoggable: Loggable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// FileHandle + TextOutputStream.swift
// SimpleLogging
//
// Created by Ben Leggiero on 2020-05-18.
// Copyright © 2020 Ben Leggiero BH-1-PS
// Created by Ky Leggiero on 2020-05-18.
//

import Foundation
Expand Down
Loading
Loading