Releases: an-dr/microlog
v7.0.0
🚨 BREAKING CHANGES: Complete API redesign since v6.5.0
New type system, unified naming, and simplified build configuration. These notes cover only part of the changes.
🌟 Added
- Output Management System — unified destination control replacing callbacks
- Custom Log Levels — define your own schemes
- Static Configuration Header — central file for all build-time options
- Optional Warning on Disabled features
- Disabling the library fully using a compilation flag (e.g., for production releases)
- Extensions — modular, copy-paste-ready examples of extending functionality through the public API.
- Syslog levels (RFC 5424)
- Thread-safe locks for CMSIS-RTOS2, FreeRTOS, POSIX, ThreadX, Windows
- Generic Logger Interface (integration layer for other libraries)
- Microlog 6 compatibility layer for easy migration
- Quality Assurance — > 85 % line and > 90 % function test coverage
🪄 Changed
- Unified naming:
- Functions →
ulog_<feature>_<method>()ulog_add_fp()→ulog_output_add_file()ulog_set_lock()→ulog_lock_set_fn()
- Types →
snake_caseulog_Event→ulog_eventulog_LogFn→ulog_log_fn
- Functions →
- Build configuration moved in-source with
ULOG_BUILD_*pattern
❌ Removed, 🐞 Fixed
- Removed emoji log levels 😭
- Removed
log_*macro aliases — useulog_*directly - Numerous fixes and stability improvements
📄 Full details: CHANGELOG.md
v7.0.0-beta.2
🌟 Added
- ULOG_BUILD_DISABLED option to completely disable the library at compile time.
- Disabled feature test to ensure no code is included when disabled.
🪄 Changed
ulog_lock_set_fnnow returnsulog_statusfor error handling when locking fails.
v7.0.0-beta.1
🚨 BREAKING CHANGES: Complete API redesign from v6.5.0. This is a major architectural overhaul with new type system, function names, and build configuration.
The changelog below consolidates all changes from alpha versions leading up to this release.
🌟 Added
Core Features
-
Output Management System: Unified system replacing callbacks for logging destinations
ulog_output_add()- Add custom callback outputsulog_output_add_file()- Add file outputsulog_output_remove()- Remove outputs dynamicallyulog_output_level_set()/ulog_output_level_set_all()- Per-output level controlULOG_OUTPUT_STDOUT- Predefined output for stdout- Topics can be bound to specific outputs via
ulog_topic_add(TOPIC, OUTPUT, LEVEL)
-
Enhanced Type System: Modern C enum types for better type safety
ulog_levelenum:ULOG_LEVEL_TRACE,ULOG_LEVEL_DEBUG,ULOG_LEVEL_INFO,ULOG_LEVEL_WARN,ULOG_LEVEL_ERROR,ULOG_LEVEL_FATALulog_statusenum:ULOG_STATUS_OK,ULOG_STATUS_ERROR,ULOG_STATUS_INVALID_ARGUMENT,ULOG_STATUS_NOT_FOUND,ULOG_STATUS_BUSY,ULOG_STATUS_DISABLEDulog_topic_idtype for topic identificationulog_outputtype for output handles
-
Custom Log Levels: Define your own level schemes
ulog_level_set_new_levels(ulog_level_descriptor)- Set custom levelsulog_level_reset_levels()- Reset to defaults- Generic
ULOG_LEVEL_0...7available for custom schemes - New macros
ulog_t(level, topic, ...)andulog(level, ...)for dynamic level logging
-
Static Configuration Header: Simplified build-time configuration
- Enable with
ULOG_BUILD_CONFIG_HEADER_ENABLED=1 - Use
ulog_config.hby default or customize withULOG_BUILD_CONFIG_HEADER_NAME
- Enable with
Extensions
-
Syslog Levels Extension (
extensions/ulog_syslog.c/.h)- RFC 5424 style severities: DEBUG, INFO, NOTICE, WARN, ERR, CRIT, ALERT, EMERG
-
Thread-Safe Lock Extensions for multiple platforms:
- CMSIS-RTOS2, FreeRTOS, POSIX, ThreadX, and Windows
-
Generic Logger Interface Extension
- Easier migration from/to other logging libraries
-
Comprehensive Documentation
- Extensions included in releases
- Documentation moved to
extensions/README.mdfor better visibility
Resource Management
ulog_topic_remove(TOPIC)- Remove topics dynamicallyulog_cleanup()- Free all dynamic resources and reset state
Event Access API
ulog_event_get_message()- Extract formatted message to bufferulog_event_get_topic()- Get topic ID from eventulog_event_get_time()- Get timestamp from eventulog_event_get_file()/ulog_event_get_line()- Get source locationulog_event_get_level()- Get log level from eventulog_event_to_cstr()- Convert event to C string
Quality Assurance
- Unit tests with >85% line coverage and >90% function coverage
🪄 Changed
API Redesign
-
Macro System: Dual macro system with improved naming
- Primary:
ulog_trace(),ulog_debug(),ulog_info(),ulog_warn(),ulog_error(),ulog_fatal() - Topic macros:
ulog_t_*()(renamed fromlogt_*) - Basic
log_*aliases removed - useulog_*directly
- Primary:
-
Function Renaming for consistency (selected examples):
ulog_get_level_string()→ulog_level_to_string()ulog_set_level()→ulog_output_level_set_all()ulog_set_quiet()→ulog_output_level_set(ULOG_OUTPUT_STDOUT, level)ulog_add_callback()→ulog_output_add()ulog_add_fp()→ulog_output_add_file()ulog_set_lock()→ulog_lock_set_fn()ulog_set_prefix_fn()→ulog_prefix_set_fn()- All topic functions now use
ulog_topic_*prefix - All configuration functions now use
*_configsuffix
-
Type Naming: Consistent snake_case convention
ulog_Event→ulog_eventulog_LogFn→ulog_log_fnulog_LockFn→ulog_lock_fnulog_PrefixFn→ulog_prefix_fn
Build Configuration Revolution
All build configuration now uses unified ULOG_BUILD_* pattern:
| Old | New |
|---|---|
!ULOG_NO_COLOR |
ULOG_BUILD_COLOR=1 |
ULOG_HAVE_TIME |
ULOG_BUILD_TIME=1 |
ULOG_CUSTOM_PREFIX_SIZE |
ULOG_BUILD_PREFIX_SIZE=N |
ULOG_EXTRA_OUTPUTS |
ULOG_BUILD_EXTRA_OUTPUTS=N |
!ULOG_HIDE_FILE_STRING |
ULOG_BUILD_SOURCE_LOCATION=1 |
ULOG_SHORT_LEVEL_STRINGS |
ULOG_BUILD_LEVEL_SHORT=1 |
ULOG_TOPICS_NUM |
ULOG_BUILD_TOPICS_MODE + ULOG_BUILD_TOPICS_STATIC_NUM |
ULOG_RUNTIME_MODE |
ULOG_BUILD_DYNAMIC_CONFIG=1 |
Topics Overhaul
-
Level-Based Control: Topics now use log levels instead of simple enable/disable
ulog_topic_add()now takes a level parameter- Replaces previous binary enabled/disabled state
-
Registration Required: All topics (static and dynamic) must use
ulog_topic_add() -
Display Format: Changed from
[Topic] LEVELtoLEVEL [Topic]
Enhanced Behavior
- Error Handling: Dynamic config functions and lock functions now return
ulog_status - Default Levels: Now aliases for generic
ULOG_LEVEL_0...7- TRACE=0, DEBUG=1, INFO=2, WARN=3, ERROR=4, FATAL=5, Upper levels (6,7) unused by default
- Visual Improvements: FATAL level color changed from magenta to "red on white"
- Feature Names: Simplified naming (Custom Prefix → Prefix, Extra Outputs → Outputs, File String → Source Location, Runtime Mode → Dynamic Config)
Documentation & Examples
- Example application completely rewritten for v7.0 API
- Better inline documentation and demonstrations
- Syslog levels and dynamic level switching examples
❌ Removed
- Emoji Levels:
ULOG_FEATURE_EMOJI_LEVELS/ULOG_USE_EMOJIcompletely removed - Direct Event Access: Event struct removed from public API (use getter functions instead)
- Legacy Topic Functions: Removed due to level-based topic system
ulog_topic_enable()/ulog_topic_enable_all()ulog_topic_disable()/ulog_topic_disable_all()
- Basic Macro Aliases:
log_*aliases removed (useulog_*directly)
🐞 Fixed
- Prefix callback execution (was called multiple times per log call)
- Potential buffer overflows in printing system
- Early exits on outputs and topics iteration after removal
- Memory allocation/deallocation for dynamic topics (including name strings)
va_listhandling issues inulog_event_get_message()andulog_event_to_cstr()- Topic string processing and validation
- Buffer handling in print system
- Various bugs in
test_time.cpp - Consistency and formatting in feature documentation
v7.0.0-alpha.4
🌟 Added
- Add extensions to the release
- Add Static Configuration Header
ulog_config.hfeature to simplify configuration. UseULOG_BUILD_CONFIG_HEADER_ENABLED=1to enable it. - Add
ULOG_BUILD_CONFIG_HEADER_NAMEto use a static configuration header instead of defaultulog_config.h.
🪄 Changed
- Move extensions documentation from
doc/extensions.mdtoextensions/README.mdfor better visibility - Revamp topics handling from enable/disable to level-based
ulog_topic_add()now takes a level parameter instead of enabled/disabled state
ULOG_BUILD_TOPICS_NUMis replaced withULOG_BUILD_TOPICS_MODEandULOG_BUILD_TOPICS_STATIC_NUM
❌ Removed
- Revamp topics handling from enable/disable to level-based
ulog_topic_enable()andulog_topic_enable_all()ulog_topic_disable()andulog_topic_disable_all()
v7.0.0-alpha.3.ext
🌟 Add extensions package to the releases
v7.0.0-alpha.3
🌟 Added
- Custom log levels via
ulog_level_set_new_levels(ulog_level_descriptor)/ulog_level_reset_levels() - Replace default levels with generic
ULOG_LEVEL_0...7- for custom level schemes. - New macros
ulog_t(level, topic, ...)andulog(level, ...)for dynamic level logging. ULOG_STATUS_DISABLEDstatus code for disabled features.- Extensions:
- Syslog levels extension (
extensions/ulog_syslog.c/.h) providing RFC 5424 style severities (DEBUG, INFO, NOTICE, WARN, ERR, CRIT, ALERT, EMERG) - Thread-safe lock extensions for CMSIS-RTOS2, FreeRTOS, POSIX, ThreadX, and Windows.
- Generic logger interface extension for easier migration from/to other logging libraries.
- New documentation page
doc/extensions.mdand README Extensions section.
- Syslog levels extension (
- Unit tests. UT coverage: >85% lines, >90% functions
🪄 Changed
ulog_prefix_set_fnnow returnsulog_statusfor error handling.- Default levels are now aliases for generic
ULOG_LEVEL_0...7. TRACE = 0, DEBUG = 1, INFO = 2, WARN = 3, ERROR = 4, FATAL = 5. Upper levels (6,7) are unused by default. - Color of
FATALlevel from "magenta" to "red on white" for better visibility. - Example application updated to demonstrate syslog levels and dynamic level switching.
ULOG_BUILD_LEVEL_STYLEreplaced withULOG_BUILD_LEVEL_SHORT(bool, 0/1) for static configuration of level style.
🐞 Fixed
- Minor consistency and formatting adjustments in feature documentation prior to extension introduction.
- Memory (de)allocation for dynamic topics, adding (de)allocation of name string.
- Potential problems with va_list in
ulog_event_get_message()andulog_event_to_cstr()
v7.0.0-alpha.2
🌟 Added
- Binding topic to a specific output via
ulog_topic_add(TOPIC, OUTPUT, ENABLED) - New status code:
ULOG_STATUS_NOT_FOUNDreturned when a topic or output is not present (previously returnedULOG_STATUS_ERROR) ulog_topic_remove(TOPIC)ulog_cleanup()to free all dynamic resources and reset added entities (topics, outputs, etc.)
🪄 Changed
- BREAKING: Topics are now require
ulog_topic_add()to be used. For both static and dynamic topics. - BREAKING: Standardized macro alias naming conventions for consistency
- Renamed topic aliases:
logt_*→ulog_t_*(e.g.,logt_info→ulog_t_info) - Removed basic aliases:
log_*→ useulog_*directly (e.g.,log_info→ulog_info)
- Renamed topic aliases:
🐞 Fixed
- Fix potential buffer overflows on printing
- Fix early exits on outputs and topics iteration after removal
v7.0.0-alpha.1
🚀 microlog v7.0.0-alpha.1 - Major Architecture Overhaul
⚠️ Breaking Changes Alert: This is a major version release with significant API changes. Please review the migration guide below before upgrading.
🌟 What's New
Output Management System (replaces callbacks)
- New
ulog_outputtype for better output control - Dynamic output management with
ulog_output_add(),ulog_output_remove() - Per-output level control with
ulog_output_level_set()
Enhanced Type System
- Proper enum types:
ulog_level,ulog_status,ulog_topic_id - Type safety improvements throughout the API
- Better completion/refactoring support in IDEs
Event Getter Functions
Events are now private, you cannot access the fields directly!
Access private event data via getters:
const char* msg = ulog_event_get_message(event);
ulog_level level = ulog_event_get_level(event);
const char* file = ulog_event_get_file(event);
...🔧 Major Changes
API Redesign
- Build Configuration:
ULOG_FEATURE_*→ULOG_BUILD_* - Log Levels:
LOG_TRACE→ULOG_LEVEL_TRACE - Function Names: Consistent
ulog_<module>_<action>pattern - Type Names: Consistent case, e.g.
ulog_Event→ulog_event
Enhanced Features
- Better message alignment: Now shows as
LEVEL [Topic]instead of[Topic] LEVEL - Improved callback system with dynamic management
- Enhanced macro system with backward compatibility
🗑️ Removed Features
- Emoji Levels: Feature removed entirely
- Direct event access: Now use getter functions for type safety
🐞 Bug Fixes
- Fixed color detection logic
- Resolved prefix callback multiple execution
- Improved topic string processing
- Enhanced memory management
🔒 Security Improvements
- Enhanced type safety with proper enums
- Better input validation
- Improved memory management
📋 Migration Guide
TBD - after release
🎯 Testing
This is an alpha release - please test thoroughly in your development environment before considering for production use.
📚 Documentation
- Updated API documentation
- New example demonstrating v7 features
v6.5.1
- 🐞 Revert breaking change after accidentally introduced ULOG_HAVE_COLOR compilation flag
Docs: https://github.com/an-dr/microlog/blob/v6.5.1/README.md