Skip to content

refactor(logger): improve structure, fix issues and add test coverage#384

Merged
Humanoidear merged 25 commits intodevelopfrom
backend/logger
Nov 14, 2025
Merged

refactor(logger): improve structure, fix issues and add test coverage#384
Humanoidear merged 25 commits intodevelopfrom
backend/logger

Conversation

@JavierRibaldelRio
Copy link
Contributor

Refactor

BaseLogger

A new logger baseLogger that contains the logic of manage internal time, and start, stop. It also contains create file function.

  • NewBaseLogger(): creates a baseLogger to be used for composition
  • Start(): starts the logger and updates start time
  • CreateFile(): given a path creates a file and returns a pointer to a file
  • PullRecord(): common implementation of PullRecord, right now only panics
  • Stop(): template function that given a procedure to stop a logger it executes it (first order logic)

orderLogger, dataLogger and protectionLogger inherit* by composition this functions, some subloggers might overwrite the functions of baselogger.

Main

Remove stateLogger and protectionsLogger because they are no longer used acording to @JFisica .

Test

Create unit test for all the subloggers, except stateLogger and protectionsLogger.

Fix

Modify dataLogger to allow having different boards monitoring variables with the same name.

@JavierRibaldelRio JavierRibaldelRio added Bug go Pull requests that update go code labels Nov 14, 2025
Copy link
Contributor

@Humanoidear Humanoidear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests pass on my machine, logger appears to work properly in the ethernet view

@Humanoidear Humanoidear merged commit d052480 into develop Nov 14, 2025
3 checks passed
@Humanoidear Humanoidear deleted the backend/logger branch November 14, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants