-
Notifications
You must be signed in to change notification settings - Fork 869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUILD][CORE] Extract the logging system into a subproject. #3119
base: master
Are you sure you want to change the base?
Conversation
…pdated sfmt implementation
…adowed local variables
@@ -17,15 +17,19 @@ | |||
#include "logsupport.hpp" | |||
#include "../srtcore/srt.h" | |||
#include "../srtcore/utilities.h" | |||
#include "ofmt.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: this and some other files were moved to ATTIC
so that they can stay as reference just in case, but they can be just as well removed. Changes visible here are only intermediate attempts and abandoned.
@ethouris How is the "C" API to the logging system affectedm, or where are the SRT_LOGFA_xxx gone? |
CMakeLists.txt
Outdated
target_compile_definitions(srt_virtual PRIVATE | ||
-DHVU_EXT_NOCXX11=1 | ||
-DHVU_EXT_MUTEX=srt::sync::Mutex | ||
-DHVU_EXT_LOCKGUARD=srt::sync::ScopedLock | ||
-DHVU_EXT_ATOMIC=srt::sync::atomic | ||
-DHVU_EXT_INCLUDE_MUTEX="sync.h" | ||
-DHVU_EXT_INCLUDE_ATOMIC="atomic.h" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target_compile_definitions(srt_virtual PRIVATE | |
-DHVU_EXT_NOCXX11=1 | |
-DHVU_EXT_MUTEX=srt::sync::Mutex | |
-DHVU_EXT_LOCKGUARD=srt::sync::ScopedLock | |
-DHVU_EXT_ATOMIC=srt::sync::atomic | |
-DHVU_EXT_INCLUDE_MUTEX="sync.h" | |
-DHVU_EXT_INCLUDE_ATOMIC="atomic.h" | |
) | |
target_compile_definitions(srt_virtual PRIVATE | |
-DHVU_EXT_NOCXX11=1 | |
-DHVU_EXT_MUTEX=srt::sync::Mutex | |
-DHVU_EXT_LOCKGUARD=srt::sync::ScopedLock | |
-DHVU_EXT_ATOMIC=srt::sync::atomic | |
-DHVU_EXT_INCLUDE_MUTEX="sync.h" | |
-DHVU_EXT_INCLUDE_ATOMIC="atomic.h" | |
) |
(formatting)
You just can't use symbolic identifiers for the FA, this has to be first obtained through the string-based name. Not sure if there's some C API for this, but this can be added. I was also thinking about having some method to access the pointer of the global variable that defines the logger. This then can allow for having a C API to access the logger directly and this way obtain the id directly from the object. Good point. |
Current state: Probably it won't be so easy to use this logging system with C++03. It is possible to configure it to work with the externally provided sync package, but in that case all applications using SRT compiled this way, which would also like to use this logging system and attach itself to the SRT's logger configuration object, need to provide the same sync library as well. |
NOTE: Prematurely merged #2964; any fixes for
ofmt.h
should apply there.Main changes:
srt.h
.The loggers now work a little bit different than before, although most of the accessing method remains intact:
id()
method.The following facilities have been moved into this project as dependency utilities, some of them placed in the
hvu
namespace:SysStrError
(the error description for the last system error) andSysLocalTime
(getting tm as local time).ThreadName
facility, which allows to modify the thread name visible in the debugger, as well as used in the logs.