diff --git a/Sources/ExampleImplementation/ConfigLogging.swift b/Sources/ExampleImplementation/ConfigLogging.swift index 2f2f92e..ba93a0f 100644 --- a/Sources/ExampleImplementation/ConfigLogging.swift +++ b/Sources/ExampleImplementation/ConfigLogging.swift @@ -8,7 +8,7 @@ import Logging // this is a contrived example of a logging library implementation that allows users to define log levels per logger label // this example uses a simplistic in-memory config which can be changed at runtime via code // real implementations could use external config files that can be changed outside the running program -public final class ConfigLogging { +public struct ConfigLogging { public var config = Config(defaultLogLevel: .info) public init() {} diff --git a/Sources/ExampleImplementation/FileLogging.swift b/Sources/ExampleImplementation/FileLogging.swift index 7821653..e500bb1 100644 --- a/Sources/ExampleImplementation/FileLogging.swift +++ b/Sources/ExampleImplementation/FileLogging.swift @@ -11,7 +11,7 @@ import Logging #endif // this is a contrived example of a logging library implementation that writes logs to files -public final class FileLogging { +public struct FileLogging { private let defaultLogLevel: Logging.Level = .info private let fileHandler = FileHandler() diff --git a/Sources/ExampleImplementation/SimpleLogger.swift b/Sources/ExampleImplementation/SimpleLogger.swift index eb3f9ec..0979c45 100644 --- a/Sources/ExampleImplementation/SimpleLogger.swift +++ b/Sources/ExampleImplementation/SimpleLogger.swift @@ -6,7 +6,7 @@ import Foundation import Logging // helper class to keep things DRY -internal final class SimpleLogger { +internal struct SimpleLogger { let label: String private var _logLevel: Logging.Level? private let formatter: DateFormatter diff --git a/Sources/ExampleImplementation/SimpleLogging.swift b/Sources/ExampleImplementation/SimpleLogging.swift index 84ec5f0..84ef76b 100644 --- a/Sources/ExampleImplementation/SimpleLogging.swift +++ b/Sources/ExampleImplementation/SimpleLogging.swift @@ -6,7 +6,7 @@ import Foundation import Logging // this is a contrived example of a logging library implementation that writes logs to stdout -public final class SimpleLogging { +public struct SimpleLogging { private let defaultLogLevel = Logging.Level.info public init() {} diff --git a/Sources/Logging/Logging.swift b/Sources/Logging/Logging.swift index f0b0297..d07a079 100644 --- a/Sources/Logging/Logging.swift +++ b/Sources/Logging/Logging.swift @@ -224,7 +224,7 @@ private class MUXLogHandler: LogHandler { } /// Ships with the logging module, really boring just prints something using the `print` function -internal final class StdoutLogger: LogHandler { +internal struct StdoutLogger: LogHandler { private let lock = Lock() public init(label: String) {}