ot-ns icon indicating copy to clipboard operation
ot-ns copied to clipboard

[cli] [fix] Fix display of OT node log information

Open EskoDijk opened this issue 3 years ago • 2 comments

OT firmware with full logs enabled wasn't working; this is now fixed. For a usable experience at the "Info" log level, detailed messages are only shown when in the context of the node. (This may have different requirements when running from script.)

It now uses the new style of short log level strings as used by OT ([C], [I], etc.)

Idea is that in simulation/node.go in the future maybe different logging policies could be applied, depending on the need. E.g. some users may have a need to write all OT node's logs to individual files for later analysis.

Also the log level of the "Watch" function is fixed - instead of warning it now uses Info.

EskoDijk avatar Aug 29 '22 14:08 EskoDijk

Codecov Report

Merging #349 (f3487a4) into main (c616148) will decrease coverage by 0.22%. The diff coverage is 38.23%.

@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
- Coverage   49.97%   49.75%   -0.23%     
==========================================
  Files          38       38              
  Lines        4608     4609       +1     
==========================================
- Hits         2303     2293      -10     
- Misses       2123     2134      +11     
  Partials      182      182              
Impacted Files Coverage Δ
cli/CmdRunner.go 23.07% <0.00%> (-0.06%) :arrow_down:
dispatcher/dispatcher.go 57.10% <0.00%> (ø)
web/site/bindata.go 99.00% <ø> (-0.01%) :arrow_down:
simulation/node.go 40.00% <9.09%> (-1.41%) :arrow_down:
otoutfilter/OTOutFilter.go 91.11% <84.61%> (-1.05%) :arrow_down:
otnstester/OtnsTest.go 89.44% <100.00%> (ø)

codecov-commenter avatar Aug 30 '22 06:08 codecov-commenter

Just added code for the proposal that if a user types "watch 1" in the CLI, then all the OT debug/info/note messages of Node 1 would be shown - regardless of the current CLI's node context. This works well with the watch command in #348. Use case example: set watch on node 1, then do a "ping 1 2" without being in node 1 context.

EskoDijk avatar Aug 30 '22 06:08 EskoDijk