-
Notifications
You must be signed in to change notification settings - Fork 129
deprecate global and process verbosity #290
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
Conversation
afaict this is only used by SwiftPM, which is addressed in swiftlang/swift-package-manager#4109 |
swiftlang/swift-package-manager#4109 @swift-ci please test |
Sources/TSCBasic/Process.swift
Outdated
Self.loggingHandler != nil | ||
} | ||
|
||
public static var loggingHandler: ((String) -> Void)? = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not in love with this static, but it is useful to be able to set this globally in SwiftPM instead of on every process invocation. open to other ideas and opinions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also thread unsafe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea i think i am going to just remove it and let the clients deal with setting a handler at the instance call site level. they can always create their own wrapper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, you can also always use a lock... but it doesn't seem like a great idea anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, I dont like this global pattern anyway. lets see how much hassle it is to do it instance level in SwiftPM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh. its quite a bit of a hassle unfortunately. I added lock for now. @weissi :/ ptal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
swiftlang/swift-package-manager#4109 @swift-ci please test |
3 similar comments
swiftlang/swift-package-manager#4109 @swift-ci please test |
swiftlang/swift-package-manager#4109 @swift-ci please test |
swiftlang/swift-package-manager#4109 @swift-ci please test |
stdoutStream <<< arguments.map({ $0.spm_shellEscaped() }).joined(separator: " ") <<< "\n" | ||
stdoutStream.flush() | ||
if let loggingHandler = self.loggingHandler { | ||
loggingHandler(arguments.map({ $0.spm_shellEscaped() }).joined(separator: " ")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\n
not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not any more, it was for the stream itself. the handler will decide what to do with it now
7c44b2d
to
c282b4a
Compare
motivation: fine grained control over verbosity setting and handling of logging changes: * deprecate global verbosity flag * deprecate Process verbosity attribute in favor of an optional logging handler (closure)
c282b4a
to
a79476b
Compare
@swift-ci please test |
motivation: fine grained control over verbosity setting and handling of logging
changes: