-
Notifications
You must be signed in to change notification settings - Fork 135
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
tfswitch -U logs instead of returning version #505
Comments
Hmm, I agree.
I think that if the desired output of an action is purely the output itself, it almost definitely shouldn’t be logged and should just be printed. I wonder whether the logging goes to stdout or stderr! 🤔
Matt
…Sent from my iPhone
On 18 Sep 2024, at 15:06, Chris Impey ***@***.***> wrote:
There appears to have been a change in the behaviour of tfswitch -U. It now returns a result via logs, which I understand from other issues appears to be a fairly recent change.
This means if you set the log level to error then you get no output at all.
❯ tfswitch -U --log-level=ERROR
❯ tfswitch -U --log-level=INFO
14:42:24.303 INFO 1.9.6
This also applies to other flags like -S and -P. Is this intended behaviour?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
I tested that and it's definitely stdout.
The output is in the stdout file |
Yep, agree too. Need to reconfigure logging to send to stderr and output to stdout only what's requested for |
Create custom log handlers, which use stderr, based on the slog ConsoleHandler Issue #505 Signed-off-by: Matthew John <matthew@dockstudios.co.uk>
…ght to stdout rather than using logging methods This avoids stylising output, as is done with logging. Avoids sending output to same destination as logs, which is now stderr Issue #505 Signed-off-by: Matthew John <matthew@dockstudios.co.uk>
@yermulnik @brainsiq I've had a quick go at this in #506 - let me know what you think :) |
…ght to stdout rather than using logging methods This avoids stylising output, as is done with logging. Avoids sending output to same destination as logs, which is now stderr Issue #505 Signed-off-by: Matthew John <matthew@dockstudios.co.uk>
Sorry for the lack of feedback, but I d/l the latest version of tswitch and the functionality now looks good to me. Not familiar with golang but was able to understand the code change too 👍 |
@brainsiq Thank you for the feedback 👍🏻 |
There appears to have been a change in the behaviour of
tfswitch -U
. It now returns a result via logs, which I understand from other issues appears to be a fairly recent change.This means if you set the log level to error then you get no output at all.
I was using
-U
to bootstrap new projects with the latest asrequired_version
, which has stopped working, and needs to be updated to instead parse the output. This isn't a big problem but wanted to check if it is intended behaviour?This also applies to other flags like
-S
and-P
but isn't consistent with-v
which returns raw output without logs.The text was updated successfully, but these errors were encountered: