Skip to content

Conversation

@Kaben123
Copy link

@Kaben123 Kaben123 commented Jan 23, 2026

Note: Please adhere to Contributing Guidelines.

Summary

This pull request introduces the use of nx_syslog in kernel space, providing a kernel-space equivalent to the standard syslog() function. The update ensures that system logging in the kernel is handled efficiently and consistently, while maintaining compatibility with user-space logging.

  • Adds the nx_syslog function for kernel-space logging.
  • Redefines syslog as nx_syslog when used in kernel space.
  • Updates relevant headers and implementation files to support the new function.

Impact

  • Enables consistent and efficient logging in kernel space using nx_syslog.
  • No impact on user-space logging or existing syslog usage in user applications.
  • Backward compatible for user-space code; kernel code now uses the new function transparently.

Testing

  • Verified that kernel-space logging uses nx_syslog as expected.
  • Confirmed that user-space logging remains unaffected.
  • No regressions observed in system logging functionality.

@github-actions github-actions bot added Area: Drivers Drivers issues Area: OS Components OS Components issues Size: S The size of the change in this PR is small labels Jan 23, 2026
@acassis
Copy link
Contributor

acassis commented Jan 23, 2026

@Kaben123 please follow the contribution guide, include the testing to prove it is working, etc. Seems like this commit never was tested, it is reporting primary errors like missing variables

@acassis acassis requested a review from cederom January 23, 2026 10:49
@xiaoxiang781216
Copy link
Contributor

@Kaben123 fix:

03160f973c syslog: use nx_syslog in kernel space
../nuttx/tools/checkpatch.sh -c -u -m -g dbbcd7c88ce1360e11773299657097fb39121c0a..HEAD
❌ Missing git commit message

Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align to Contributing Guidelines.

Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this kind of change was already proposed by @wangchdo in #17018, and eventually the implementation in #17267 was merged . I don't see the added benefit of this change?

Introduce nx_syslog for kernel-space logging and redefine syslog as
nx_syslog in kernel builds. Ensures efficient and consistent logging
in the kernel while maintaining user-space compatibility.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Drivers Drivers issues Area: OS Components OS Components issues Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants