[riot-notifications] [RIOT-OS/RIOT] syslog: add a simple syslog module (#15739)

Vincent Dupont notifications at github.com
Mon Jan 11 16:47:23 CET 2021

### Contribution description

This adds a simple syslog module that prints string whose format is compatible with rfc5424.

This module is organized into 2 layers:
- a core that receives logs, format them, and dispatch them to backends
- backends that actually print strings. At the moment stdio and file backend are implemented.

stdio backend simply prints out to stdio.
File backend prints in a file and take care of file rotation (configurable at build time).

API-wise, it is inspired by Linux' syslog API. The entry point is `(v)syslog` and optionally `openlog` and `closelog` can be built to allow adding different log entries.

### Testing procedure

`tests/syslog` provides some simple commands to do basic tests.

### Issues/PRs references

Some parts of header files were initially inspired by #11362

You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * syslog: add basic syslog implementation
  * shell: add syslog commands
  * tests: add syslog test app

-- File Changes --

    M core/include/log.h (23)
    M makefiles/pseudomodules.inc.mk (1)
    M sys/Kconfig (1)
    M sys/Makefile.dep (8)
    M sys/auto_init/auto_init.c (4)
    A sys/include/syslog.h (276)
    M sys/shell/commands/Makefile (4)
    A sys/shell/commands/sc_syslog.c (64)
    M sys/shell/commands/shell_commands.c (7)
    A sys/syslog/Kconfig (100)
    A sys/syslog/Makefile (7)
    A sys/syslog/backend.c (50)
    A sys/syslog/backend.h (109)
    A sys/syslog/backend_file.c (211)
    A sys/syslog/syslog.c (621)
    A tests/syslog/Makefile (18)
    A tests/syslog/main.c (96)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210111/d15c5359/attachment.htm>

More information about the notifications mailing list