Skip to content
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

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

yousefg-codes
Copy link

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.

@yousefg-codes yousefg-codes requested a review from asheffie1 August 7, 2024 00:05
@yousefg-codes yousefg-codes force-pushed the live555-verkada-backup-log-hotfix branch from 1c30d51 to 033dc86 Compare August 7, 2024 20:48
@@ -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'
Copy link
Collaborator

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?

Copy link
Author

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.

Copy link
Collaborator

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);
Copy link
Collaborator

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.

Copy link
Author

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.

Copy link
Collaborator

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);
Copy link
Collaborator

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().)

@yousefg-codes yousefg-codes force-pushed the live555-verkada-backup-log-hotfix branch from 57256cc to 6555ed9 Compare August 7, 2024 23:41
@yousefg-codes yousefg-codes merged commit b0b214c into live555-verkada Aug 7, 2024
1 check passed
@asheffie1 asheffie1 deleted the live555-verkada-backup-log-hotfix branch December 5, 2024 00:53
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