Fix log filters not working, disable debug level logging by default
@@ -119,8 +119,10 @@ namespace carto {
}
std::lock_guard<std::mutex> lock(_Mutex);
+ if (_ShowError) {
OutputLog(LOG_TYPE_ERROR, _Tag, message);
}
+ }
void Log::Warn(const char* message) {
DirectorPtr<LogEventListener> logEventListener = _LogEventListener;
@@ -131,8 +133,10 @@ namespace carto {
}
std::lock_guard<std::mutex> lock(_Mutex);
+ if (_ShowWarn) {
OutputLog(LOG_TYPE_WARNING, _Tag, message);
}
+ }
void Log::Info(const char* message) {
DirectorPtr<LogEventListener> logEventListener = _LogEventListener;
@@ -143,8 +147,10 @@ namespace carto {
}
std::lock_guard<std::mutex> lock(_Mutex);
+ if (_ShowInfo) {
OutputLog(LOG_TYPE_INFO, _Tag, message);
}
+ }
void Log::Debug(const char* message) {
DirectorPtr<LogEventListener> logEventListener = _LogEventListener;
@@ -155,8 +161,10 @@ namespace carto {
}
std::lock_guard<std::mutex> lock(_Mutex);
+ if (_ShowDebug) {
OutputLog(LOG_TYPE_DEBUG, _Tag, message);
}
+ }
Log::Log() {
}
@@ -164,7 +172,7 @@ namespace carto {
bool Log::_ShowError = true;
bool Log::_ShowWarn = true;
bool Log::_ShowInfo = true;
- bool Log::_ShowDebug = true;
+ bool Log::_ShowDebug = false;
std::string Log::_Tag = "carto-mobile-sdk";
