Skip to content

[BUILD][CORE] Extract the logging system into a subproject.#3119

Merged
ethouris merged 93 commits into
Haivision:devfrom
ethouris:dev-extract-logging-system
Aug 26, 2025
Merged

[BUILD][CORE] Extract the logging system into a subproject.#3119
ethouris merged 93 commits into
Haivision:devfrom
ethouris:dev-extract-logging-system

Conversation

@ethouris
Copy link
Copy Markdown
Collaborator

@ethouris ethouris commented Feb 20, 2025

NOTE: Prematurely merged #2964; any fixes for ofmt.h should apply there.

Main changes:

  1. Removed explicitly defined identifiers in the logger FAs. Identifiers are still in use, but they are autogenerated and available through the logger global variable method id(). FA symbols are no longer a generated part of srt.h.
  2. String-based dispatching to the logger is now built in into the logger. Loggers are registering themselves in the map during the initialization time.
  3. The logging subproject can be potentially used in other projects. This can be moved to another repository and to be pinned into SRT repository as submodule, as well as used independently in other projects.
  4. The minimum utilities required for the logger to function have been moved to the logger sources. This can be partially controversial, but these things bring in dependencies of the logging system.
  5. The namespace for the logger symbols and the name for the configuration object are customizable. Potentially the configuration object can be implemented as a global variable, but a singleton is a safe form in case of being a dependent object.

The loggers now work a little bit different than before, although most of the accessing method remains intact:

  1. You can still refer to the logger through its ID using the configuration object.
  2. You can dispatch the ID using the string-based name through the configuration object.
  3. This ID can be used to switch on/off particular FA.
  4. If you have a direct access to the global variable designating the logger, you can obtain its ID through id() method.

The following facilities have been moved into this project as dependency utilities, some of them placed in the hvu namespace:

  1. The compat part, SysStrError (the error description for the last system error) and SysLocalTime (getting tm as local time).
  2. The ThreadName facility, which allows to modify the thread name visible in the debugger, as well as used in the logs.
  3. The "ofmt" facility, which provides better formatting facility for sequential printable arguments.

ethouris and others added 30 commits May 24, 2024 19:04
@ethouris ethouris mentioned this pull request Mar 13, 2025
45 tasks
@ethouris ethouris changed the base branch from master to dev March 18, 2025 16:41
@ethouris ethouris merged commit 148e2f0 into Haivision:dev Aug 26, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants