xiaoxiang781216 commented on a change in pull request #3050: URL: https://github.com/apache/incubator-nuttx/pull/3050#discussion_r594028016
########## File path: drivers/syslog/syslog_channel.c ########## @@ -141,8 +145,14 @@ int syslog_channel(FAR const struct syslog_channel_s *channel) { DEBUGASSERT(channel->sc_putc != NULL && channel->sc_force != NULL); - g_syslog_channel = channel; - return OK; + for (int i = 0; i < CONFIG_SYSLOG_MAX_CHANNELS; i++) Review comment: > I can think of another solution. (Which I also don't like very much...) > > Maybe the first call to `syslog_channel` will substitute the default channel, and every subsequent call will append the new channel to the list. > > On the other hand, any reason of not just moving to `_add` & `_remove` functions? `_add` functions can't resolve the problem I mentioned before. We need the replacement semantics when CONFIG_SYSLOG_MAX_CHANNELS == 1 regardless how you name the function. > I will most probably add the `_remove` variant in this PR, because it is needed (I just don't have the time today). Yes, I think so. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org