Skip to content
Snippets Groups Projects
Commit 48cb5f92 authored by Richard van der Hoff's avatar Richard van der Hoff
Browse files

Add olm::log_enabled_for

parent 11dbf2aa
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,8 @@ const unsigned int LOG_TRACE = 6;
void set_log_level(unsigned int log_level);
bool log_enabled_for(unsigned int level, const char *category);
__attribute__((__format__ (__printf__, 3, 4)))
void logf(unsigned int level, const char *category,
const char *format, ...);
......
......@@ -26,6 +26,11 @@ void set_log_level(unsigned int level) {
log_level = level;
}
bool log_enabled_for(unsigned int level, const char *category)
{
return level <= log_level;
}
void logf(unsigned int level, const char *category,
const char *format, ...) {
if (level > log_level) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment