Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logs: Add support for reading number of entries since an index for a particular log #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vrahane
Copy link
Contributor

@vrahane vrahane commented Mar 21, 2024

Related mcumgr PR: apache/mynewt-mcumgr#172
Related mynewt-core PR: apache/mynewt-core#3168

Example:
Successful/Valid case:

$newtmgr --connstring peer_name="my_dev" --conntype oic_ble log num_entries reboot_log 0
Number of entries: 43
$newtmgr --connstring peer_name="my_dev" --conntype oic_ble log show reboot_log
Status: 0
Next index: 482
Name: reboot_log
Type: STORAGE
   [num_entries]    [index]            [timestamp] |         [module]          [level] [type]    [img] [message]
               0         16     1578455591078191us |       REBOOT (6)     CRITICAL (4)   cbor 71983333 {"cnt":311,"flags":"active bootable confirmed","hash":"719833337dcbb8cb4c0fc7356799faffde5614b93db2762eb769a7e6da3e7c95","img":"24.3.25.121935","rsn":"OTHER: 0x0"}
               1        416     1578474526687539us |       REBOOT (6)     CRITICAL (4)   cbor 9d378656 {"cnt":312,"flags":"active bootable confirmed","hash":"9d37333354ec570426e4284708a1b6d3a66278ee4633f705bb379d331331fe04","img":"24.3.25.173430","rsn":"OTHER: 0x0"}

Error case:

<Invalid log>
$newtmgr --connstring peer_name="my_dev" --conntype oic_ble log num_entries reboot 0
error: 5

<Invalid index>
$newtmgr --connstring peer_name="my_dev" --conntype oic_ble log num_entries reboot 4000
error: 5

@vrahane vrahane marked this pull request as ready for review March 26, 2024 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant