Skip to content

Commit c60c016

Browse files
committed
Re #5566 Improve online documentation for dump-logs
1 parent 34013b7 commit c60c016

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

doc/build_command.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ The same Cabal flag name can be set (or unset) for multiple packages (at the
198198
command line only) with:
199199

200200
~~~text
201-
stack build --flag *:[-]<flag)name>
201+
stack build --flag *:[-]<flag_name>
202202
~~~
203203

204204
!!! note
@@ -555,14 +555,15 @@ package is targetted in a multi-package project (for example, using
555555
`stack build <package_name>`).
556556

557557
* **One target package:** The build output for the target package is sent to the
558-
console as it happens.
558+
standard error output stream of the console as it happens.
559559

560560
* **More than one target package:** The build output from GHC (as opposed to
561561
from Stack) for each target package is sent to a log file for that package,
562-
unless an error occurs. At the end of the build, the location of the directory
563-
containing the log files is reported. To also output the contents of the log
564-
files to the console at the end of the build, use Stack's `dump-logs` option.
565-
For further information about that option, see the
562+
unless an error occurs that prevents that. At the end of the build, the
563+
location of the directory containing the log files is reported. To also output
564+
the contents of the log files to the standard error output stream of the
565+
console at the end of the build, use Stack's `dump-logs` option. For further
566+
information about that option, see the
566567
[YAML configuration](yaml_configuration.md#dump-logs) documentation. The
567568
default `dump-logs` mode is to output the contents of the log files that are
568569
warnings.

doc/yaml_configuration.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -687,12 +687,13 @@ Command line equivalent (takes precedence): `--[no-]dump-logs` flag
687687

688688
In the case of *non-interleaved* output and *more than one* target package,
689689
Stack sends the build output from GHC for each target package to a log file,
690-
unless an error occurs. For further information, see the
691-
[`stack build --[no-]interleaved-output` flag](build_command.md#the-stack-build---no-interleaved-output-flag)
690+
unless an error occurs that prevents that. For further information, see the
691+
[`stack build --[no-]interleaved-output` flag](build_command.md#-no-interleaved-output-flag)
692692
documentation.
693693

694694
The value of the `dump-logs` key controls what, if any, log file content is sent
695-
('dumped') to the console at the end of the build. Possible values are:
695+
('dumped') to the standard error output stream of the console at the end of the
696+
build. Possible values are:
696697

697698
~~~yaml
698699
dump-logs: none # don't dump the content of any log files
@@ -703,6 +704,15 @@ dump-logs: all # dump all of the content of log files
703704
At the command line, `--no-dump-logs` is equivalent to `dump-logs: none` and
704705
`--dump-logs` is equivalent to `dump-logs: all`.
705706

707+
If GHC reports an error during the build and a log file is created, that build
708+
output will be included in the log file. Stack will also report errors during
709+
building to the standard error output stream. That stream can be piped to a
710+
file. For example, for a file named `stderr.log`:
711+
712+
~~~text
713+
stack --no-dump-logs --color always build --no-interleaved-output 2> stderr.log
714+
~~~
715+
706716
### extra-include-dirs
707717

708718
Default: `[]`

0 commit comments

Comments
 (0)