mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.5 KiB
Objective-C
45 lines
1.5 KiB
Objective-C
//
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import <CocoaLumberjack/CocoaLumberjack.h>
|
|
|
|
#define LOG_LEVEL_DEF sskLogLevel
|
|
#define LOG_ASYNC_ENABLED YES
|
|
|
|
#ifdef DEBUG
|
|
static const NSUInteger sskLogLevel = DDLogLevelAll;
|
|
#else
|
|
static const NSUInteger sskLogLevel = DDLogLevelInfo;
|
|
#endif
|
|
|
|
#import "Asserts.h"
|
|
#import "Constraints.h"
|
|
#import "NSObject+OWS.h"
|
|
#import "OWSAnalytics.h"
|
|
#import "OWSDispatch.h"
|
|
#import "iOSVersions.h"
|
|
|
|
#define BLOCK_SAFE_RUN(block, ...) \
|
|
block ? dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), \
|
|
^{ \
|
|
block(__VA_ARGS__); \
|
|
}) \
|
|
: nil
|
|
#define SYNC_BLOCK_SAFE_RUN(block, ...) block ? block(__VA_ARGS__) : nil
|
|
|
|
#define MacrosSingletonImplemention \
|
|
+(instancetype)sharedInstance { \
|
|
static dispatch_once_t onceToken; \
|
|
static id sharedInstance = nil; \
|
|
dispatch_once(&onceToken, ^{ \
|
|
sharedInstance = [self.class new]; \
|
|
}); \
|
|
\
|
|
return sharedInstance; \
|
|
}
|
|
|
|
#define MacrosSingletonInterface +(instancetype)sharedInstance;
|