Microlog Extensions

October 23, 2025 ยท View on GitHub

This directory contains extensions for the Microlog logging library.

The extensions are designed to be easy to understand and modify. They are not part of distributed packages (meson, CMake, etc.)! Feel free to copy-paste and adapt them to your needs. If you create a useful extension, please consider submitting a PR.

For information about interface and usage see the extension headers in the extensions/ folder.


Level Extensions

This set of extensions provides alternative log level descriptors that can be enabled at runtime. They replace the default levels defined in ulog.h.

ExtensionDescriptionMain Header
SyslogRFC 5424 style severity names replacing the default logging levelsulog_syslog.h

Lock Extensions

This set of extensions provides mutex/lock helpers for various platforms / RTOSes. They allow you to enable locking in the core logger with minimal effort.

When to Use a Lock? Enable a lock if multiple threads, tasks, or ISRs (with proper exclusion) may log concurrently and you require atomic event dispatch. If logging originates from signal handlers / ISRs ensure the underlying primitive is safe (often it is not โ€” consider a lock-free ring buffer output pattern instead for hard real-time).

ExtensionDescriptionMain Header
CMSISCMSIS-RTOS2 mutex lock helperulog_lock_cmsis.h
FreeRTOSFreeRTOS mutex lock helperulog_lock_freertos.h
POSIXpthread mutex lock helperulog_lock_pthread.h
ThreadXThreadX mutex lock helperulog_lock_threadx.h
WindowsWindows Critical Section lock helperulog_lock_win.h

Other Extensions

This set of extensions provides additional logging features and integrations.

ExtensionDescriptionMain Header
Generic Logger InterfaceProvides a generic logging interface that can simplify migration from/to other logging libraries.ulog_generic_interface.h
microlog6 CompatibilityBackward compatibility layer for code written against microlog v6.x API.ulog_microlog6.h

Adding Your Own Extension

  1. Create extensions/ulog_<name>.h/.c.
  2. Expose a small enable/disable API returning ulog_status.
  3. Keep core dependency limited to ulog.h.
  4. Document usage in the header and add it to this file.

Feel free to submit a PR with additional platforms or higher-level outputs.