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

Pretty print long commands #1836

Open
harendra-kumar opened this issue Feb 24, 2016 · 5 comments
Open

Pretty print long commands #1836

harendra-kumar opened this issue Feb 24, 2016 · 5 comments

Comments

@harendra-kumar
Copy link
Collaborator

I was trying to debug a problem and turned on verbose mode. The output of verbose seems pretty unreadable. I was interested in looking at what flags or command line options are being used for cabal. This is the output that I saw:

2016-02-24 18:35:37.653768: [debug] Run process: /var/home/harendra/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 configure --with-ghc=/var/home/harendra/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc --with-ghc-pkg=/var/home/harendra/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/var/home/harendra/.stack/snapshots/x86_64-linux/lts-5.4/7.10.3/pkgdb --package-db=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/pkgdb --libdir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/lib --bindir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/bin --datadir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/share --libexecdir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/libexec --sysconfdir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/etc --docdir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/doc/xls-0.1.0.0 --htmldir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/doc/xls-0.1.0.0 --haddockdir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/doc/xls-0.1.0.0 --dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d --dependency=conduit=conduit-1.2.6.2-bbb6e8792dc10ebfaa0881ed8bfacb02 --dependency=filepath=filepath-1.4.0.0-f97d1e4aebfd7a03be6980454fe31d6e --dependency=resourcet=resourcet-1.1.7.2-78775b086032749956bd24405bc310bc --dependency=transformers=transformers-0.4.2.0-81450cd8f86b36eaa8fa0cbaf6efc3a3 --ghc-options -E --enable-tests --enable-benchmarks @(stack_62J5TCkgvzXEzDvUwWp35R:System.Process.Read src/System/Process/Read.hs:269:3)

I had to use tr on this to make some sense out of it:

 | tr ' ' '\n'
2016-02-24
18:35:37.653768:
[debug]
Run
process:
/var/home/harendra/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3
--builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0
configure
--with-ghc=/var/home/harendra/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc
--with-ghc-pkg=/var/home/harendra/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc-pkg
--user
--package-db=clear
--package-db=global
--package-db=/var/home/harendra/.stack/snapshots/x86_64-linux/lts-5.4/7.10.3/pkgdb
--package-db=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/pkgdb
--libdir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/lib
--bindir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/bin
--datadir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/share
--libexecdir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/libexec
--sysconfdir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/etc
--docdir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/doc/xls-0.1.0.0
--htmldir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/doc/xls-0.1.0.0
--haddockdir=/vol/hosts/cueball/workspace/projects/xls/.stack-work/install/x86_64-linux/lts-5.4/7.10.3/doc/xls-0.1.0.0
--dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d
--dependency=conduit=conduit-1.2.6.2-bbb6e8792dc10ebfaa0881ed8bfacb02
--dependency=filepath=filepath-1.4.0.0-f97d1e4aebfd7a03be6980454fe31d6e
--dependency=resourcet=resourcet-1.1.7.2-78775b086032749956bd24405bc310bc
--dependency=transformers=transformers-0.4.2.0-81450cd8f86b36eaa8fa0cbaf6efc3a3
--ghc-options
-E
--enable-tests
--enable-benchmarks
@(stack_62J5TCkgvzXEzDvUwWp35R:System.Process.Read
src/System/Process/Read.hs:269:3)

It will be helpful in debugging if we can pretty print the long command outputs by default.

@luigy
Copy link
Contributor

luigy commented Feb 24, 2016

Yes, ui can get some love

Can we have a new label for this kind of issues similar to UI or UX like in opam or npm? :)
There are a few open that would have to be tagged

@mgsloan
Copy link
Contributor

mgsloan commented Feb 25, 2016

Good idea!

@luigy Makes sense! To me UX seems too general and UI evokes something interactive. How about "component: output"?

@mgsloan mgsloan added this to the P3: Optional milestone Feb 25, 2016
@luigy
Copy link
Contributor

luigy commented Feb 26, 2016

@mgsloan Yes, I'm fine with any name :)

I mean is kind of a little bit of everything depending on who you word things, but that is probably just my intuition xD

UI/UX/component:ouput for example

  • colored output to better track warnings vs info vs commands ran
  • more eyecandy with colors + emojis (I hope I'm not alone and doesn't impact perf ;) )
  • something like stack new --interactive awesome that only asks for missing params if any?
  • after running stack build and a package is taking too long pressing [ i ] key shows the output of what is doing, assuming output was hidden in the first place

the last two are interactivish, right?

PS: my bad for hijacking the issue

@mgsloan
Copy link
Contributor

mgsloan commented Feb 27, 2016

@luigy I've created component: output (UI/UX). Feel free to open up issues about such ideas :D, though I dunno about the emojis ;)

Though perhaps stack could keep track of how many times you've gotten compile errors, and work through the series of :suspect: :hurtrealbad: :rage1: :rage2: :rage3: :rage4: :goberserk: :feelsgood: :finnadie: ;)

@luigy
Copy link
Contributor

luigy commented Feb 28, 2016

I've created component: output (UI/UX)

it's official 🎉

Though perhaps stack could keep track of how many times you've gotten compile errors, and work through the series of :suspect: :hurtrealbad: :rage1: :rage2: :rage3: :rage4: :goberserk: :feelsgood: :finnadie: ;)

haha! excellent use case of emojis, I want!

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

No branches or pull requests

4 participants