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

[BUG] Enhance SRT_ASSERT to print a log message #2974

Open
maxsharabayko opened this issue Jul 9, 2024 · 1 comment
Open

[BUG] Enhance SRT_ASSERT to print a log message #2974

maxsharabayko opened this issue Jul 9, 2024 · 1 comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Milestone

Comments

@maxsharabayko
Copy link
Collaborator

Release builds of SRT disable all the SRT_ASSERT assertions.
I might still be useful to print an error log message in that case.

#ifdef _DEBUG
#if defined(SRT_ENABLE_THREADCHECK)
#include "threadcheck.h"
#define SRT_ASSERT(cond, logger, msg) ASSERT(cond)
#else
#include <assert.h>
#define SRT_ASSERT(cond, logger, msg) assert(cond)
#endif
#else
#define SRT_ASSERT(cond, logger, msg) LOGC(logger.Error, log << "msg");
#endif
@maxsharabayko maxsharabayko added Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core labels Jul 9, 2024
@maxsharabayko maxsharabayko added this to the v1.5.4 milestone Jul 9, 2024
@ethouris
Copy link
Collaborator

You can use glog logger by default (using the full namespace path). This logger is almost not used, but this one is always turned on (that is, can't be blocked by FA selection).

@maxsharabayko maxsharabayko modified the milestones: v1.5.4, v1.6.0 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

No branches or pull requests

2 participants