Skip to content

Releases: an-dr/microlog

v7.0.0

23 Oct 20:05
3ad3c74

Choose a tag to compare

🚨 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_case
      • ulog_Eventulog_event
      • ulog_LogFnulog_log_fn
  • Build configuration moved in-source with ULOG_BUILD_* pattern

❌ Removed, 🐞 Fixed

  • Removed emoji log levels 😭
  • Removed log_* macro aliases — use ulog_* directly
  • Numerous fixes and stability improvements

📄 Full details: CHANGELOG.md

v7.0.0-beta.2

15 Oct 21:36
da78056

Choose a tag to compare

v7.0.0-beta.2 Pre-release
Pre-release

🌟 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_fn now returns ulog_status for error handling when locking fails.

v7.0.0-beta.1

09 Oct 20:57

Choose a tag to compare

v7.0.0-beta.1 Pre-release
Pre-release

🚨 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 outputs
    • ulog_output_add_file() - Add file outputs
    • ulog_output_remove() - Remove outputs dynamically
    • ulog_output_level_set() / ulog_output_level_set_all() - Per-output level control
    • ULOG_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_level enum: ULOG_LEVEL_TRACE, ULOG_LEVEL_DEBUG, ULOG_LEVEL_INFO, ULOG_LEVEL_WARN, ULOG_LEVEL_ERROR, ULOG_LEVEL_FATAL
    • ulog_status enum: ULOG_STATUS_OK, ULOG_STATUS_ERROR, ULOG_STATUS_INVALID_ARGUMENT, ULOG_STATUS_NOT_FOUND, ULOG_STATUS_BUSY, ULOG_STATUS_DISABLED
    • ulog_topic_id type for topic identification
    • ulog_output type for output handles
  • Custom Log Levels: Define your own level schemes

    • ulog_level_set_new_levels(ulog_level_descriptor) - Set custom levels
    • ulog_level_reset_levels() - Reset to defaults
    • Generic ULOG_LEVEL_0...7 available for custom schemes
    • New macros ulog_t(level, topic, ...) and ulog(level, ...) for dynamic level logging
  • Static Configuration Header: Simplified build-time configuration

    • Enable with ULOG_BUILD_CONFIG_HEADER_ENABLED=1
    • Use ulog_config.h by default or customize with ULOG_BUILD_CONFIG_HEADER_NAME

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.md for better visibility

Resource Management

  • ulog_topic_remove(TOPIC) - Remove topics dynamically
  • ulog_cleanup() - Free all dynamic resources and reset state

Event Access API

  • ulog_event_get_message() - Extract formatted message to buffer
  • ulog_event_get_topic() - Get topic ID from event
  • ulog_event_get_time() - Get timestamp from event
  • ulog_event_get_file() / ulog_event_get_line() - Get source location
  • ulog_event_get_level() - Get log level from event
  • ulog_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 from logt_*)
    • Basic log_* aliases removed - use ulog_* directly
  • 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 *_config suffix
  • Type Naming: Consistent snake_case convention

    • ulog_Eventulog_event
    • ulog_LogFnulog_log_fn
    • ulog_LockFnulog_lock_fn
    • ulog_PrefixFnulog_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] LEVEL to LEVEL [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_EMOJI completely 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 (use ulog_* 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_list handling issues in ulog_event_get_message() and ulog_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

09 Oct 20:58

Choose a tag to compare

v7.0.0-alpha.4 Pre-release
Pre-release

🌟 Added

  • Add extensions to the release
  • Add Static Configuration Header ulog_config.h feature to simplify configuration. Use ULOG_BUILD_CONFIG_HEADER_ENABLED=1 to enable it.
  • Add ULOG_BUILD_CONFIG_HEADER_NAME to use a static configuration header instead of default ulog_config.h.

🪄 Changed

  • Move extensions documentation from doc/extensions.md to extensions/README.md for 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_NUM is replaced with ULOG_BUILD_TOPICS_MODE and ULOG_BUILD_TOPICS_STATIC_NUM

❌ Removed

  • Revamp topics handling from enable/disable to level-based
    • ulog_topic_enable() and ulog_topic_enable_all()
    • ulog_topic_disable() and ulog_topic_disable_all()

v7.0.0-alpha.3.ext

23 Sep 19:42

Choose a tag to compare

v7.0.0-alpha.3.ext Pre-release
Pre-release

🌟 Add extensions package to the releases

v7.0.0-alpha.3

17 Sep 18:39

Choose a tag to compare

v7.0.0-alpha.3 Pre-release
Pre-release

🌟 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, ...) and ulog(level, ...) for dynamic level logging.
  • ULOG_STATUS_DISABLED status 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.md and README Extensions section.
  • Unit tests. UT coverage: >85% lines, >90% functions

🪄 Changed

  • ulog_prefix_set_fn now returns ulog_status for 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 FATAL level from "magenta" to "red on white" for better visibility.
  • Example application updated to demonstrate syslog levels and dynamic level switching.
  • ULOG_BUILD_LEVEL_STYLE replaced with ULOG_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() and ulog_event_to_cstr()

v7.0.0-alpha.2

08 Sep 15:28
7e39938

Choose a tag to compare

v7.0.0-alpha.2 Pre-release
Pre-release

🌟 Added

  • Binding topic to a specific output via ulog_topic_add(TOPIC, OUTPUT, ENABLED)
  • New status code: ULOG_STATUS_NOT_FOUND returned when a topic or output is not present (previously returned ULOG_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_infoulog_t_info)
    • Removed basic aliases: log_* → use ulog_* directly (e.g., log_infoulog_info)

🐞 Fixed

  • Fix potential buffer overflows on printing
  • Fix early exits on outputs and topics iteration after removal

v7.0.0-alpha.1

04 Sep 16:49

Choose a tag to compare

v7.0.0-alpha.1 Pre-release
Pre-release

🚀 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_output type 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_TRACEULOG_LEVEL_TRACE
  • Function Names: Consistent ulog_<module>_<action> pattern
  • Type Names: Consistent case, e.g. ulog_Eventulog_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

24 Aug 16:03
6a647d0

Choose a tag to compare

  • 🐞 Revert breaking change after accidentally introduced ULOG_HAVE_COLOR compilation flag

Docs: https://github.com/an-dr/microlog/blob/v6.5.1/README.md

v6.5.0

28 Jul 08:03
b64de8c

Choose a tag to compare

  • 🌟 Add Runtime Configuration mode
    • With it enabled, you can compile a library with nearly all features enabled and control them from the code!