Skip to content

Commit 4675d74

Browse files
authored
Remove Logger's dependency to BundleInfo (#41)
1 parent 2ad036f commit 4675d74

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Sources/LoggerDependency/Logger.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@
3939
/// logger.log("Paid with bank account \(accountNumber)")
4040
/// ```
4141
public subscript(subsystem subsystem: String, category category: String) -> Logger {
42-
return Logger(subsystem: subsystem, category: category)
42+
Logger(subsystem: subsystem, category: category)
4343
}
4444
/// Creates a `Logger` value where messages are categorized by the provided argument.
45-
/// The `Logger`'s subsystem is the bundle identifier, extracted from the ``BundleInfo``
46-
/// dependency.
45+
/// The `Logger`'s subsystem is the bundle identifier.
4746
///
4847
/// You can use this subscript on the `\.logger` dependency:
4948
/// ```swift
@@ -52,8 +51,7 @@
5251
/// logger.log("Paid with bank account \(accountNumber)")
5352
/// ```
5453
public subscript(category: String) -> Logger {
55-
@Dependency(\.bundleInfo) var bundleInfo
56-
return Logger(subsystem: bundleInfo.bundleIdentifier, category: category)
54+
Logger(subsystem: Bundle.main.bundleIdentifier ?? "", category: category)
5755
}
5856
}
5957
#endif

0 commit comments

Comments
 (0)