commercialhaskell / commercialhaskell/stack

Pretty print long commands

Open
#1,836 5 comments 0 reactions 0 assignees View on GitHub
component: logging component: output (UI/UX) type: enhancement
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.