]> Cypherpunks.ru repositories - goredo.git/blob - doc/logs.texi
Recursive serialized logs capability
[goredo.git] / doc / logs.texi
1 @node Logs
2 @unnumbered Logs
3
4 @code{stderr} of the running targets can be kept on the disk by
5 specifying @option{-k} option (or by setting @env{$REDO_LOGS=1}
6 environment variable) to @command{redo}. You can simultaneously
7 use also @option{-s} option (@env{$REDO_SILENT=1} environment variable)
8 to silence @code{stderr} output, but still keeping it on the disk for
9 possible further debug investigation. @strong{Only} the latest build is
10 kept, previous one is overwritten.
11
12 @example
13 $ redo -xx -k -s build-the-whole-huge-project
14 @end example
15
16 Logs are stored in corresponding @file{.redo/tgt.log} file. Each line of
17 it is prefixed with @url{http://cr.yp.to/libtai/tai64.html, TAI64N}
18 timestamp, that you can decode with @command{tai64nlocal} utility from
19 @url{http://cr.yp.to/daemontools.html, daemontools}, or similar one:
20 @code{go get go.cypherpunks.ru/tai64n/cmd/tai64nlocal}.
21
22 When @option{-k} is in use, all environment variables, working
23 directory, command line arguments, start/finish times, duration,
24 participated PIDs, return codes are also saved in corresponding
25 @file{.redo/tgt.log.reg} file.
26
27 You can view any target's output with @command{redo-log} command
28 (possibly piping to @command{tai64nlocal}). @option{-c} option also
29 shows how exactly it was started, when started/finished and how long did
30 it take.
31
32 @option{-r} option enables recursive serialized indented output. When
33 you run @command{redo} in parallel, then all @code{stderr} (if no
34 @option{-s}ilence was enabled) is printed as it appears, mixing output
35 from all commands, that is hard to read and investigate. Serialized
36 @command{redo-log} output rearranges output. I will take example from
37 original apenwarr's idea @url{https://apenwarr.ca/log/20181106,
38 article}. Serialized output will look like this:
39
40 @verbatim
41 $ redo-log -r A
42 A: ...A stuff...
43 A: redo-ifchange J
44 J: > redo J
45 J: > ...J stuff...
46 J: > redo-ifchange X Y
47 X: > > redo X
48 X: > > ...X stuff...
49 X: > > done X
50 J: > > redo Y
51 Y: > > ...Y stuff...
52 Z: > > > redo Z
53 Z: > > > ...Z stuff...
54 Z: > > > done Z
55 Y: > > ...more Y stuff...
56 Y: > > done Y
57 J: > ...more J stuff...
58 J: > done J
59 A: ...more A stuff...
60 @end verbatim
61
62 It will output depth first logs. It can rearrange some "events" (redo
63 invocations): failed targets will be at the very end, because they are
64 the most interesting ones for the human.
65
66 Pay attention that recursive output is more CPU hungry. Single target
67 output is literally copying of @file{.redo/tgt.log} file to @code{stdout}.