Skip to content
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

Create verbose argument for all commands #39

Closed
santos88 opened this issue May 29, 2018 · 9 comments · Fixed by #1027
Closed

Create verbose argument for all commands #39

santos88 opened this issue May 29, 2018 · 9 comments · Fixed by #1027

Comments

@santos88
Copy link
Contributor

Would be a good point add a verbose argument (--verbose || -v)

@pepicrft
Copy link
Contributor

For which command would you add it @santos88 ?

@pepicrft
Copy link
Contributor

Following up in this issue, would you be interested in getting a verbose output from any of the commands? Which information would you like to get?

@ollieatkinson
Copy link
Collaborator

reopening this issue.

It would be very good to add a verbose mode to help track down where failures happen.
I would like to be able to see the following:

  • the shell commands Tuist is executing
  • the output for the shell commands Tuist is executing, always
  • file operations Tuist is performing
  • debug and info log messages giving information about the current state Tuist is currently in

This is not a fully inclusive list, I'm sure there are other's we can introduce here.

@ollieatkinson ollieatkinson reopened this Sep 24, 2019
@parse
Copy link

parse commented Oct 2, 2019

+1 on this, I am trying to debug whether the tuist generate is using the bundler version of the gem or the system wide and it would be great to have that information in a --verbose flag.

@pepicrft
Copy link
Contributor

pepicrft commented Oct 8, 2019

Thanks for the suggestions. I agree the flag should be supported to make the debugging of Tuist's commands easier. Would you be interested in contributing yourself to the project by adding support for that flag to the generate command @parse? If so, I can point you to some areas of the codebase that would be impacted by that work.

@parse
Copy link

parse commented Oct 8, 2019

Thanks for the suggestions. I agree the flag should be supported to make the debugging of Tuist's commands easier. Would you be interested in contributing yourself to the project by adding support for that flag to the generate command @parse? If so, I can point you to some areas of the codebase that would be impacted by that work.

I am sorry to say I don't have the time at the moment. My ambition is to get involved this upcoming spring.

@pepicrft
Copy link
Contributor

pepicrft commented Oct 9, 2019

I am sorry to say I don't have the time at the moment. My ambition is to get involved this upcoming spring.

Sure! No worries. I'll keep the issue in the backlog to not forget about it.

@ollieatkinson
Copy link
Collaborator

ollieatkinson commented Feb 9, 2020

So I've restarted the Logging work, so far I am going to propose that we use swift-log (https://github.com/apple/swift-log).

To use this we will need to consolidate all of our logging, this means refactoring all of the current methods of printing to console and colourising the logs. Thankfully Tuist has exposed all of this through Printing so the actual work won't be challenging just time-consuming.

Each module inside of Tuist will define the label specific for that subsystem, the property will be internal and only accessible from withinside that module - for testing we can write our own LogHandler and bootstrap it against the LoggingSystem.

let logger = Logger(label: "io.tuist.support")

At the call-site when we want to use this the API will look fairly similar to what we are used to

logger.warning("\(deprecation) will be deprecated in the next major release. Use \(suggestion) instead.")

I will define two new logging types, OSLogHandler and ConsoleLogHandler.

OSLogHandler can be used for writing to the system and extracting logs from Console.app so that when we recieve bug reports we have a better chance of knowing whats wrong - I do not know what the default level of logging for this should be yet, but we can decide this later.

ConsoleLogHandler will replace Printing and will do the writing to the users console. This will have to inherit the attribute styling for all the text, as well as printing to stdout and stderr depending on the level of the log.

Once we have this mechanism in place, we can then look at exposing a command line option for raising or lowering the logging level for each of the logging types.

@pepibumur How does this sound?

@ollieatkinson
Copy link
Collaborator

I have created a work-in-progress branch so that we can form a detailed discussion about the direction of this work:

https://github.com/tuist/tuist/tree/verbose-logging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants