map_log_enum_pattern: a dictionary mapping Enum of the logs to their corresponding log patterns.
Event(time, log_type, logger_name, event_type, params): a log whose type is specified in map_log_enum_pattern.
Add functions
Network.get_events(): returns a dictionary that maps each node to a tuple of Event, which happened in itself.
Fixes
Fix wait_for_log to remove the ANSI color control codes to make parsing easier.
Add more tests
Bunches of tests of test_logs.py and test_log_aggregation.py.
Ensure all logs are emitted after all operations in the tests.
TODO
[x] Parameters handler for each type of log
[x] Fix the slow Node.wait_fot_log()
[x] Unit-test for discovershard
[x] parse_logs for each node
[x] Unit-test for get_events
Issues
[x] wait_for_log calls grep in the shell, whose regex is slightly different from the one in the Python module re. Need to modify something like REGEX_LIST, to ensure the regex also works in grep.
Note: there is a comparison table between linux grep and python, however only in Chinese: link
What was wrong?
https://github.com/ethresearch/sharding-p2p-poc/issues/149
How was it fixed?
Features
Add data structures
map_log_enum_pattern
: a dictionary mapping Enum of the logs to their corresponding log patterns.Event(time, log_type, logger_name, event_type, params)
: a log whose type is specified inmap_log_enum_pattern
.Add functions
Network.get_events()
: returns a dictionary that maps each node to a tuple ofEvent
, which happened in itself.Fixes
wait_for_log
to remove the ANSI color control codes to make parsing easier.Add more tests
test_logs.py
andtest_log_aggregation.py
.TODO
Node.wait_fot_log()
discovershard
parse_logs
for each nodeget_events
Issues
wait_for_log
callsgrep
in the shell, whose regex is slightly different from the one in the Python modulere
. Need to modify something likeREGEX_LIST
, to ensure the regex also works ingrep
.Cute Animal Picture