no message

This commit is contained in:
Peter
2017-03-21 19:59:03 +03:00
parent 45c19fbc4c
commit 333b5c0ffc
2 changed files with 7 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ extern "C" {
bool MTLogEnabled();
void MTLog(NSString *format, ...);
void MTLogSetLoggingFunction(void (*function)(NSString *, va_list args));
void MTLogSetEnabled(bool);
#ifdef __cplusplus
}

View File

@@ -9,9 +9,10 @@
#import "MTLogging.h"
static void (*loggingFunction)(NSString *, va_list args) = NULL;
static bool MTLogEnabledValue = true;
bool MTLogEnabled() {
return loggingFunction != NULL;
return loggingFunction != NULL && MTLogEnabledValue;
}
void MTLog(NSString *format, ...) {
@@ -26,3 +27,7 @@ void MTLog(NSString *format, ...) {
void MTLogSetLoggingFunction(void (*function)(NSString *, va_list args)) {
loggingFunction = function;
}
void MTLogSetEnabled(bool enabled) {
MTLogEnabledValue = enabled;
}