anchao opened a new pull request, #14923:
URL: https://github.com/apache/nuttx/pull/14923

   ## Summary
   
   libc/stdout: add an option to redirect standard output stream to syslog
   
   Redirect standard output stream of printf(), vprintf(), puts(), putchar() to 
syslog,
   This option will ensure the printing sequence of syslog/printf to avoid
   confusion. Noted that if enable this option, the redirection
   capability of standard input(<) and output(>) will not be work as expect in
   (nsh)nuttx shell.
   
   Signed-off-by: chao an <[email protected]>
   
   ## Impact
   
   N/A
   
   ## Testing
   
   sim/nsh
   
   1. enable SYSLOG_STDOUT/SYSLOG_STDOUT_PREFIX
   
   2. test code in hello
   
   ```
   int main(int argc, FAR char *argv[])
   {
     printf("Hello, World!!\n");
     syslog(1, "Hello, World!!\n");
     return 0;
   }
   ```
   3. check result
   
   ```
   $ ./nuttx 
   NuttShell (NSH) NuttX-10.4.0
   nsh> hello
   [    1.030000] [ 4] [NOTICE] Hello, World!!
   [    1.030000] [ 4] [ ALERT] Hello, World!!
   nsh> 
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to