feat: Adopt swift-log#47
Merged
djones6 merged 9 commits intoKitura:masterfrom Jun 6, 2019
djones6:swift-log
Merged
Conversation
Add comments on public API Use isSwiftLogging() so that mapping between loggers is not duplicated
Remove unnecessary import Update copyright header
ianpartridge
reviewed
Jun 5, 2019
Sources/LoggerAPI/Logger.swift
Outdated
| /// | ||
| /// - Returns: A Boolean indicating whether a message of the specified type | ||
| /// will be logged via the registered `LoggerAPI.Logger`. | ||
| public class func isLoggingToLoggerAPI(_ level: LoggerMessageType) -> Bool { |
Collaborator
There was a problem hiding this comment.
I'm not sure this public API carries its weight. We can always add it in future if needed but for now I think internal is fine.
Sources/LoggerAPI/Logger.swift
Outdated
| /// | ||
| /// - Returns: A Boolean indicating whether a message of the specified type | ||
| /// will be logged via the registered `Logging.Logger`. | ||
| public class func isLoggingToSwiftLog(_ level: LoggerMessageType) -> Bool { |
Collaborator
There was a problem hiding this comment.
I'm not sure this public API carries its weight. We can always add it in future if needed but for now I think internal is fine.
ianpartridge
approved these changes
Jun 6, 2019
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provides a way for applications written against LoggerAPI (such as Kitura) to log via swift-log, either as an alternative or in addition to a LoggerAPI logger (such as HeliumLogger).
This introduces a new dependency on that project, using their recommended syntax for compatibility with Swift 4 (swift-log 0.x release) and Swift 5 (1.x release).
It also adds locking around accesses to the
loggerandswiftLoggerglobal variables, as these are accessed by multiple threads. Although these vars may typically be assigned once during application init, there's nothing to prevent them from being reassigned during execution - nor would we want to prevent them from being reassigned: for example, in response to some event, an application might decide it would be helpful to increase log verbosity or start logging to a file.Resolves #46