xiaoxiang781216 commented on PR #17018:
URL: https://github.com/apache/nuttx/pull/17018#issuecomment-3364091347

   
   > HI @xiaoxiang781216
   > 
   > I believe we should add this new front-end function to syslog(), in order 
to support the following behaviors in together with current syslog functions:
   > 
   > ```
   > 1. Lightweight: users can be assured that syslog will only perform 
   >    formatted output of the provided input string
   
   which functionality you want to disable, but the syslog framework doesn't 
provide Kconfig for you? Please point out explicitly.
   
   > 2. Deterministic: No buffering in either task or interrupt context
   
   You can disable CONFIG_SYSLOG_BUFFER and CONFIG_SYSLOG_INTBUFFER to remove 
ALL syslog buffer.
   
   > 3. simple: No spinlock or critical section protection, ensuring there is 
no risk 
   >    of deadlock or crash caused by these mechanisms 
   >    (users must handle protection themselves if needed)
   
   the lock is required in SMP and multi-thread context.
   
   > 4. can be used almost everywhere: output directed only to `up_putc()`
   
   syslog by default output only to up_putc, doesn't enable other backend can 
achieve your goal directly.
   
   > ```
   > 
   > If we attempt to achieve these by modifying the existing backend 
implementation, it would have two drawbacks:
   > 
   > ```
   > 1. It could make syslog more difficult for users to use.
   > 2. If users are very expert, and changed the backend, he or she may lose 
the benefits of the current default syslog, such as 
   >    buffering, spinlock protection, and the additional debug information 
   >    it provides
   > ```.
   > ```
   
   Your implementation can only work in the very special context(before 
scheduler start, or after scheduler stop), so my suggestion is:
   
   1. Add a simple function(e.g. early_syslog) which call up_putc directly
   2. Document this function can only be used before scheduler start or after 
scheduler stop


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