-
Notifications
You must be signed in to change notification settings - Fork 0
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
Stop live555 logger from claiming it's backing up when it actually isn't #2
Stop live555 logger from claiming it's backing up when it actually isn't #2
Conversation
1c30d51
to
033dc86
Compare
@@ -21,4 +21,4 @@ jobs: | |||
run: ./genMakefiles linux | |||
|
|||
- name: Make All live555 targets | |||
run: make CPPFLAGS='-DLOG_FILE_TMP_DIR="\"/test/path\""' | |||
run: make CPPFLAGS='-DDEBUG -DDEBUG_SEND' |
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.
Looks like we're providing two new defines (DEBUG
and DEBUG_SEND
) we weren't previously providing - What do these do and why weren't we using them earlier?
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.
This is just a simple github workflow I made to make sure that the branch always compiles without errors. These flags enable debug prints, but in this case I'm enabling them just to make sure any code that falls under them is compiled, these are already being used in the camera-firmware live555 bitbake though.
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.
Ah makes sense, thanks for explaining.
void SetLevel(LogLevel level); | ||
void SetTmpLogDir(std::string logDirectory); |
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.
Is it intentional to allow the client to change the log directory during runtime? If not, this should be a private function so client can't call it.
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.
Yes it's intentional. Changing it during runtime is what allows us to enable backing up and logging to a tmp directory. I left the compile-time flag in there just in case anyone wants to use it and doesn't want to use the SetTmpLogDir function.
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.
OK that fine, but in that case we need to protect SetTmpLogDir()
function body with our mutex to be safe.
(I know in theory SetTmpLogDir()
should be called before any debug prints happen, but we want to protect against future changes where things could get moved around and prints might happen concurrently with the client calling SetTmpLogDir()
.)
void SetLevel(LogLevel level); | ||
void SetTmpLogDir(std::string logDirectory); |
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.
OK that fine, but in that case we need to protect SetTmpLogDir()
function body with our mutex to be safe.
(I know in theory SetTmpLogDir()
should be called before any debug prints happen, but we want to protect against future changes where things could get moved around and prints might happen concurrently with the client calling SetTmpLogDir()
.)
57256cc
to
6555ed9
Compare
Added a condition for backing up the logs (don't want to hard code the backup condition, will do that in the firmware repo), to prevent backup from occurring when it shouldn't.