fjpanag commented on a change in pull request #3050:
URL: https://github.com/apache/incubator-nuttx/pull/3050#discussion_r593888974



##########
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 don't think this will work as intended.  
   `syslog_channel` is used in many places, like `syslog_file_channel` or 
`syslog_console_channel`.
   
   I would expect a call to `syslog_file_channel` for example to add another 
channel, instead of overwriting the old one.
   
   Alternatively, `syslog_channel` may be completely removed, and substituted 
with `syslog_channel_add` and `syslog_channel_remove`, so the user has the 
ability to set up whatever log channels combination they want?




----------------------------------------------------------------
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


Reply via email to