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