This is the central manager of logging. A developer should not have to interact with this class, it is exclusively used internally.
Active log modules
@property (nonatomic, copy, readonly) NSSet<SDLLogFileModule *> *_Nonnull modules;
var modules: Set<AnyHashable> { get }
Active log targets
@property (nonatomic, copy, readonly) NSSet<id<SDLLogTarget>> *_Nonnull targets;
var targets: Set<AnyHashable> { get }
Active log filters
@property (nonatomic, copy, readonly) NSSet<SDLLogFilter *> *_Nonnull filters;
var filters: Set<AnyHashable> { get }
Any modules that do not have an explicitly specified level will by default use this log level
@property (nonatomic, readonly) SDLLogLevel globalLogLevel;
var globalLogLevel: SDLLogLevel { get }
Active log format
@property (nonatomic, readonly) SDLLogFormatType formatType;
var formatType: SDLLogFormatType { get }
Whether or not verbose, debug, and warning logs are logged asynchronously. If logs are performed async, then some may be missed in the event of a terminating signal such as an exception, but performance is improved and your code will not be slowed by logging.
Defaults to TRUE
@property (nonatomic, readonly, getter=isAsynchronous) BOOL asynchronous;
var isAsynchronous: Bool { get }
Whether or not error logs are logged asynchronously. If logs are performed async, then some may be missed in the event of a terminating signal such as an exception, but performance is improved and your code will not be slowed by logging.
Defaults to FALSE
@property (nonatomic, assign, unsafe_unretained, readonly,
getter=areErrorsAsynchronous) BOOL errorsAsynchronous;
var areErrorsAsynchronous: Bool { get }
Whether or not assert logs will fire assertions in DEBUG mode. Assertions are always disabled in RELEASE builds. If assertions are disabled, only an error log will fire instead. Defaults to NO.
@property (nonatomic, assign, unsafe_unretained, readonly,
getter=areAssertionsDisabled) BOOL disableAssertions;
var areAssertionsDisabled: Bool { get }
Active date formatter
@property (class, nonatomic, strong, readonly) NSDateFormatter *_Nonnull dateFormatter;
class var dateFormatter: DateFormatter { get }
The queue asynchronously logged logs are logged on. Say that 10 times fast.
@property (class, nonatomic, readonly) dispatch_queue_t _Nonnull logQueue;
unowned(unsafe) class var logQueue: DispatchQueue { get }
The singleton object
+ (nonnull SDLLogManager *)sharedManager;
class func shared() -> SDLLogManager
The singleton object
Sets a configuration to be used by the log manager’s sharedManager. This is generally for internal use and you should set your configuration using SDLManager’s startWithConfiguration: method.
+ (void)setConfiguration:(nonnull SDLLogConfiguration *)configuration;
class func setConfiguration(_ configuration: SDLLogConfiguration)
The configuration to be used.
Sets a configuration to be used by the log manager. This is generally for internal use and you should set your configuration using SDLManager’s startWithConfiguration: method.
- (void)setConfiguration:(nonnull SDLLogConfiguration *)configuration;
func setConfiguration(_ configuration: SDLLogConfiguration)
The configuration to be used.
Log to the sharedManager’s active log targets. This is used internally to log. If you want to create a log, you should use macros such as SDLLogD
.
+ (void)logWithLevel:(SDLLogLevel)level
timestamp:(nonnull NSDate *)timestamp
file:(nonnull NSString *)file
functionName:(nonnull NSString *)functionName
line:(NSInteger)line
queue:(nonnull NSString *)queueLabel
formatMessage:(nonnull NSString *)message, ...;
The level of the log
The time the log was sent
The file the log originated from
The function the log originated from
The line the log originated from
The queue the log was sent from
The message of the log with a format
Log to this log manager’s active log targets. This is used internally to log. If you want to create a log, you should use macros such as SDLLogD
.
- (void)logWithLevel:(SDLLogLevel)level
timestamp:(nonnull NSDate *)timestamp
file:(nonnull NSString *)file
functionName:(nonnull NSString *)functionName
line:(NSInteger)line
queue:(nonnull NSString *)queueLabel
formatMessage:(nonnull NSString *)message, ...;
The level of the log
The time the log was sent
The file the log originated from
The function the log originated from
The line the log originated from
The queue the log was sent from
The message of the log with a format
Log to this sharedManager’s active log targets. This is used internally to log. If you want to create a log, you should use macros such as SDLLogD
.
+ (void)logWithLevel:(SDLLogLevel)level
timestamp:(nonnull NSDate *)timestamp
file:(nonnull NSString *)file
functionName:(nonnull NSString *)functionName
line:(NSInteger)line
queue:(nonnull NSString *)queueLabel
message:(nonnull NSString *)message;
class func log(with level: SDLLogLevel, timestamp: Date, file: String, functionName: String, line: Int, queue queueLabel: String, message: String)
The level of the log
The time the log was sent
The file the log originated from
The function the log originated from
The line the log originated from
The queue the log was sent from
The message of the log
Log to this log manager’s active log targets. This is used internally to log. If you want to create a log, you should use macros such as SDLLogD
.
- (void)logWithLevel:(SDLLogLevel)level
timestamp:(nonnull NSDate *)timestamp
file:(nonnull NSString *)file
functionName:(nonnull NSString *)functionName
line:(NSInteger)line
queue:(nonnull NSString *)queueLabel
message:(nonnull NSString *)message;
func log(with level: SDLLogLevel, timestamp: Date, file: String, functionName: String, line: Int, queue queueLabel: String, message: String)
The level of the log
The time the log was sent
The file the log originated from
The function the log originated from
The line the log originated from
The queue the log was sent from
The message of the log
Log to this sharedManager’s active log targets. This is used internally to log.
+ (void)logBytes:(nonnull NSData *)data
direction:(SDLLogBytesDirection)direction
timestamp:(nonnull NSDate *)timestamp
file:(nonnull NSString *)file
functionName:(nonnull NSString *)functionName
line:(NSInteger)line
queue:(nonnull NSString *)queueLabel;
class func logBytes(_ data: Data, direction: SDLLogBytesDirection, timestamp: Date, file: String, functionName: String, line: Int, queue queueLabel: String)
The data to be logged
Whether its transmit or receive data
The time the log was sent
The file the log originated from
The function the log originated from
The line the log originated from
The queue the log was sent from
Log to this manager’s active log targets. This is used internally to log.
- (void)logBytes:(nonnull NSData *)data
direction:(SDLLogBytesDirection)direction
timestamp:(nonnull NSDate *)timestamp
file:(nonnull NSString *)file
functionName:(nonnull NSString *)functionName
line:(NSInteger)line
queue:(nonnull NSString *)queueLabel;
func logBytes(_ data: Data, direction: SDLLogBytesDirection, timestamp: Date, file: String, functionName: String, line: Int, queue queueLabel: String)
The data to be logged
Whether its transmit or receive data
The time the log was sent
The file the log originated from
The function the log originated from
The line the log originated from
The queue the log was sent from
Log an error to the sharedManager’s active log targets and assert. This is used internally to log.
+ (void)logAssertWithTimestamp:(nonnull NSDate *)timestamp
file:(nonnull NSString *)file
functionName:(nonnull NSString *)functionName
line:(NSInteger)line
queue:(nonnull NSString *)queueLabel
formatMessage:(nonnull NSString *)message, ...;
The time the log was sent
The file the log originated from
The function the log originated from
The line the log originated from
The queue the log was sent from
The message of the log
Log an error to this manager’s active log targets and assert. This is used internally to log.
- (void)logAssertWithTimestamp:(nonnull NSDate *)timestamp
file:(nonnull NSString *)file
functionName:(nonnull NSString *)functionName
line:(NSInteger)line
queue:(nonnull NSString *)queueLabel
formatMessage:(nonnull NSString *)message, ...;
The time the log was sent
The file the log originated from
The function the log originated from
The line the log originated from
The queue the log was sent from
The message of the log