Skip to content

feat: add picolib.raft_log utility function

Georgy Moshkin requested to merge feat/picolib.raft_log into master

It prints the raft log in a concise and readable way

> picolib.raft_log()

example output:

+-----+----+-----+---------------------------------------------------------------------------------------------------+
|index|term| lc  |                                             contents                                              |
+-----+----+-----+---------------------------------------------------------------------------------------------------+
|  1  | 1  |1.0.0|                      persist_peer(i1, 1, r1, localhost:4301, Online, 1, {})                       |
|  2  | 1  |1.0.1|                                           persist_rf(1)                                           |
|  3  | 1  |     |                                            promote(1)                                             |
|  4  | 2  |     |                                                 -                                                 |
|  5  | 2  |1.1.2|                      persist_peer(i1, 1, r1, localhost:4301, Online, 5, {})                       |
|  6  | 2  |1.1.3|                                       eval("return 1 + 1")                                        |
|  7  | 2  |1.1.4|info("this is a very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo|
|  ~  | ~  |  ~  |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo|
|  ~  | ~  |  ~  |                                    ooooooooooooooooooong line")                                   |
+-----+----+-----+---------------------------------------------------------------------------------------------------+

Merge request reports