This commit is contained in:
Vipul Agarwal 2020-10-21 01:09:47 +05:30
Родитель cd4666286a
Коммит 59e6942bf8
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -16,7 +16,7 @@ LOGMANAGER_INSTANCE
@implementation ODWLogManager @implementation ODWLogManager
static BOOL initialized = false; static BOOL _initialized = false;
+(nullable ODWLogger *)loggerWithTenant:(nonnull NSString *)tenantToken +(nullable ODWLogger *)loggerWithTenant:(nonnull NSString *)tenantToken
{ {
@ -27,7 +27,7 @@ static BOOL initialized = false;
source:(nonnull NSString *)source source:(nonnull NSString *)source
{ {
// If log manager is not initialized, try initializing it. If that fails, return nil else return the logger. // If log manager is not initialized, try initializing it. If that fails, return nil else return the logger.
if (!initialized && ![ODWLogManager initializeLogManager:tenantToken withConfig:nil]) if (!_initialized && ![ODWLogManager initializeLogManager:tenantToken withConfig:nil])
{ {
return nil; return nil;
} }
@ -55,7 +55,7 @@ static BOOL initialized = false;
+(nullable ODWLogger *)initForTenant:(nonnull NSString *)tenantToken withConfig:(nullable NSDictionary *)config +(nullable ODWLogger *)initForTenant:(nonnull NSString *)tenantToken withConfig:(nullable NSDictionary *)config
{ {
ILogger *logger = [ODWLogManager initializeLogManager:tenantToken withConfig:config]; ILogger *logger = [ODWLogManager initializeLogManager:tenantToken withConfig:config];
initialized = logger != NULL; _initialized = logger != NULL;
if (!logger) return nil; if (!logger) return nil;
@ -102,7 +102,7 @@ static BOOL initialized = false;
// Initialize SDK Log Manager // Initialize SDK Log Manager
std::string strToken = std::string([tenantToken UTF8String]); std::string strToken = std::string([tenantToken UTF8String]);
logger = LogManager::Initialize(strToken, logManagerConfig); logger = LogManager::Initialize(strToken, logManagerConfig);
// Obtain semantics values // Obtain semantics values
NSBundle* bundle = [NSBundle mainBundle]; NSBundle* bundle = [NSBundle mainBundle];
NSLocale* locale = [NSLocale currentLocale]; NSLocale* locale = [NSLocale currentLocale];
@ -185,7 +185,7 @@ static BOOL initialized = false;
{ {
PerformActionWithCppExceptionsCatch(^(void) { PerformActionWithCppExceptionsCatch(^(void) {
LogManager::FlushAndTeardown(); LogManager::FlushAndTeardown();
initialized = false; _initialized = false;
}); });
} }