Skip to content

Log system with rotation #35

@anarchyysm

Description

@anarchyysm

Problem

Goal: logs persist on the SD card and do not grow indefinitely.
Estimated effort: 1 day

Proposed Solution

  • Create Service/storage_api/include/tos_log.h
  • Create Service/storage_api/tos_log.c
  • Implement log writing to TOS_PATH_LOGS "/system.log"
  • Implement rotation: when reaching 2MB, rename to system.log.bak and create a new system.log
  • Implement SD check before every write (storage_is_mounted())
  • Integrate with log_level values defined in config/system.conf (info, debug, error)
  • Test: generate logs in a loop — confirm rotation triggers at 2MB

Use Case

No response

Alternatives Considered

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions