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

Adding a logging system for haicrypt #359

Merged
merged 7 commits into from
May 24, 2018

Conversation

ethouris
Copy link
Collaborator

No description provided.


#include "hcrypt.h"
#include "../srtcore/srt.h"
#include "../srtcore/logging.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This adds another logging API wrapper on top of already complicated logging API wrapper. Can we please stick to single logging API ("srtcore/logging.h")? If we must have "Templates made C way" variation that should probably go into "srtcore/logging.h" as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The purpose of this wrapper is to fill the existing uses of logging instructions in haicrypt with the implementation of the SRT logging system. Haicrypt, as a C project, can't use the C++ logging API from SRT directly, this wrapper is for only that sole purpose. This wrapper isn't predicted to serve for anything else, that's why the wrapper is implemented in haicrypt project, not in srtcore.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Having C-style logging API available throughout the project is a good thing and actually has been asked for in the past. Also, there are benefits of having all logging functionality in one place: it makes it clearer why the "C template" done the way it is and if we want to improve/change logging implementation at a later time we will only have one place to work on. Please move this code to srtcore.

(void)logfa;
(void)level;
return 0;
static char buf[4096];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please avoid returning non-const static buffers from a function. There is really no need for this: just pass destination buffer and its length as arguments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change is common with that of #365, so the fix applied there will have to be rebased here, after #365 is merged.

@rndi rndi merged commit acc0ae8 into Haivision:master May 24, 2018
@ethouris ethouris deleted the dev-add-haicrypt-logging-alt branch May 28, 2018 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants