[mynewt-core] branch master updated: sys/log: Add clearing log to log command
This is an automated email from the ASF dual-hosted git repository. wes3 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git The following commit(s) were added to refs/heads/master by this push: new a7ea0b0aa sys/log: Add clearing log to log command a7ea0b0aa is described below commit a7ea0b0aab1a07a36d0f863587664970d43ae254 Author: Will San Filippo AuthorDate: Thu Apr 28 14:20:18 2022 -0700 sys/log: Add clearing log to log command This commit adds the ability to clear a log, a group of logs or all logs using the 'log' shell command. The option -c was added for this purpose. The syntax is similar to the log dump syntax. --- sys/log/full/src/log_shell.c | 45 ++-- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/sys/log/full/src/log_shell.c b/sys/log/full/src/log_shell.c index 716ae86c2..48db8a822 100644 --- a/sys/log/full/src/log_shell.c +++ b/sys/log/full/src/log_shell.c @@ -109,16 +109,25 @@ shell_log_dump_cmd(int argc, char **argv) uint32_t log_limit = 0; bool stream; bool partial_match = false; +bool clear_log; int i; int rc; +clear_log = false; for (i = 1; i < argc; ++i) { if (0 == strcmp(argv[i], "-l")) { list_only = true; break; } -if (isdigit((unsigned char)argv[i][0])) { + +/* the -c option is to clear a log (or logs). */ +if (!strcmp(argv[i], "-c")) { +clear_log = true; +} else if (isdigit((unsigned char)argv[i][0])) { log_limit = parse_ll_bounds(argv[i], 1, 100, ); +if (clear_log) { +goto err; +} } else { log_name = argv[i]; if ('*' == log_name[strlen(log_name) - 1]) { @@ -149,21 +158,29 @@ shell_log_dump_cmd(int argc, char **argv) continue; } -console_printf("Dumping log %s\n", log->l_name); - -log_offset.lo_arg = NULL; -log_offset.lo_ts = 0; -log_last_index = log_get_last_index(log); -if (log_limit == 0 || log_last_index < log_limit) { -log_offset.lo_index = 0; +if (clear_log) { +console_printf("Clearing log %s\n", log->l_name); +rc = log_flush(log); +if (rc != 0) { +goto err; +} } else { -log_offset.lo_index = log_last_index - log_limit; -} -log_offset.lo_data_len = 0; +console_printf("Dumping log %s\n", log->l_name); + +log_offset.lo_arg = NULL; +log_offset.lo_ts = 0; +log_last_index = log_get_last_index(log); +if (log_limit == 0 || log_last_index < log_limit) { +log_offset.lo_index = 0; +} else { +log_offset.lo_index = log_last_index - log_limit; +} +log_offset.lo_data_len = 0; -rc = log_walk_body(log, shell_log_dump_entry, _offset); -if (rc != 0) { -goto err; +rc = log_walk_body(log, shell_log_dump_entry, _offset); +if (rc != 0) { +goto err; +} } }
[GitHub] [mynewt-core] wes3 merged pull request #2825: sys/log: Add clearing log to log command
wes3 merged PR #2825: URL: https://github.com/apache/mynewt-core/pull/2825 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2853: hw/bsp/dialog: Add missing #include
apache-mynewt-bot commented on PR #2853: URL: https://github.com/apache/mynewt-core/pull/2853#issuecomment-1160634336 ## Style check summary No suggestions at this time! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #1280: nimble/ll:: Make LL task stack size configurable
apache-mynewt-bot commented on PR #1280: URL: https://github.com/apache/mynewt-nimble/pull/1280#issuecomment-1160624944 ## Style check summary No suggestions at this time! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [mynewt-core] andrzej-kaczmarek opened a new pull request, #2853: hw/bsp/dialog: Add missing #include
andrzej-kaczmarek opened a new pull request, #2853: URL: https://github.com/apache/mynewt-core/pull/2853 Need to include syscfg.h since it uses MYNEWT_VAL_CHOICE(). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [mynewt-nimble] andrzej-kaczmarek commented on pull request #1280: nimble/ll:: Make LL task stack size configurable
andrzej-kaczmarek commented on PR #1280: URL: https://github.com/apache/mynewt-nimble/pull/1280#issuecomment-1160520414 why this is defined in phy instead of controller pkg? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [mynewt-nimble] sjanc opened a new pull request, #1280: nimble/ll:: Make LL task stack size configurable
sjanc opened a new pull request, #1280: URL: https://github.com/apache/mynewt-nimble/pull/1280 This commit makes LL stack size configurable. Depending on compiler and platform default value may not be enough. It was reported that on nRF52840 90 words is not enough even if Ext Adv is disabled. To keep things simple lets just increase default stack size to 120 word for all usecases (with exception of nRF51 where defults to 96 bytes). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [mynewt-nimble] sjanc opened a new issue, #1279: Add babblesim targets to CI
sjanc opened a new issue, #1279: URL: https://github.com/apache/mynewt-nimble/issues/1279 CI should build babblesim targets and eventually also execute tests via edtt -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #1278: ble_conn: fix auth_pyld_timer memleak
apache-mynewt-bot commented on PR #1278: URL: https://github.com/apache/mynewt-nimble/pull/1278#issuecomment-1160012674 ## Style check summary No suggestions at this time! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [mynewt-nimble] bvdberg opened a new pull request, #1278: ble_conn: fix auth_pyld_timer memleak
bvdberg opened a new pull request, #1278: URL: https://github.com/apache/mynewt-nimble/pull/1278 Every time a connection is made, the ble_npl_callout_init() is done. This causes a timer creation in some NPL cases (eg. FreeRTOS). The alloc behaviour of auth_pyld_timer is now in sync with ctrl_proc_rsp_timer that lives in the same struct. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org