Skip to content

Latest commit

 

History

History
85 lines (55 loc) · 4.38 KB

File metadata and controls

85 lines (55 loc) · 4.38 KB

SimpleLog-Challenge

High-Performance, Cross-Platform Logging Library for C/C++

Author: Thuan Nguyen Thai
Other contributors: None
Created: April 24, 2025

Problem Statement

  • Providing a logger which is simple-STABLE-powerful for embedded devices to PC and mainframe with flexible configuration.
  • Multi-process C/C++ logger, portable.
  • A meaningful demo for Systems Programming inspired by W. Richard Stevens(1951-1999).

Requirements

  • POSIX thread/POSIX APIs in UNIX-Like.
  • Win32 APIs in Windows.

Background and References

  • No.

🧩 Proposed Design

Component Description
Log folder [Mandatory] pathfolder=
Daily [Mandatory]
Log rotation [Mandatory] rotation_size=
Time [Mandatory] [yyyy-mm-dd hh-mm-ss.nano]
Info [Mandatory] [tid] [pid] [file:func:line]
Number of CPU [Mandatory] ncpu=
topic [Optional] topic=, can comment this feature.
Log level [Mandatory] level=.
Buffer size [Mandatory] buffsize=.
Timer trigger [Mandatory] trigger=.
Safe size of message [Mandatory] max_sz_msg=.
Shared memory key [Mandatory] shared_key=.
process_mode [Mandatory] process_mode=.

🛠️ Exported APIs

SimpleLog-Challenge provides 5 key APIs for initializing, logging, and process control:

APIs Description
int spc_init_log_ext(SPC_INPUT_ARG *input); [Mandatory] Initialize the logger with extended input settings.
int spc_finish_log(); [Mandatory] Finalize and clean up the logger.
spclog(log_level, fmt, ...); [Mandatory] Log a message with the specified level.
spclogtopic(log_level, topic_index, fmt, ...); [Optional] Log by topics= from 1 to n.
LLU spc_update_processid(); [Optional] Update process ID, typically used after fork() example.

Alternatives Considered

  • No. It should be one more option. It should NOT alternate any libraries, but is really worthy to try with new applications.

Impact

  • No.

Organizational

  • Does this proposal require a new repository? No.
  • Which repositories are expected to be modified to execute this design? phosphor-logging

Testing and Validation

References