Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
iOS Documentation
SDLLogManager

SDLLogManager Class Reference

Section Contents

Overview

This is the central manager of logging. A developer should not have to interact with this class, it is exclusively used internally.

modules

Active log modules

Objective-C

@property (nonatomic, copy, readonly) NSSet<SDLLogFileModule *> *_Nonnull modules;

Swift

var modules: Set<AnyHashable> { get }

targets

Active log targets

Objective-C

@property (nonatomic, copy, readonly) NSSet<id<SDLLogTarget>> *_Nonnull targets;

Swift

var targets: Set<AnyHashable> { get }

filters

Active log filters

Objective-C

@property (nonatomic, copy, readonly) NSSet<SDLLogFilter *> *_Nonnull filters;

Swift

var filters: Set<AnyHashable> { get }

globalLogLevel

Any modules that do not have an explicitly specified level will by default use this log level

Objective-C

@property (nonatomic, readonly) SDLLogLevel globalLogLevel;

Swift

var globalLogLevel: SDLLogLevel { get }

formatType

Active log format

Objective-C

@property (nonatomic, readonly) SDLLogFormatType formatType;

Swift

var formatType: SDLLogFormatType { get }

asynchronous

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

Objective-C

@property (nonatomic, readonly, getter=isAsynchronous) BOOL asynchronous;

Swift

var isAsynchronous: Bool { get }

errorsAsynchronous

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

Objective-C

@property (nonatomic, assign, unsafe_unretained, readonly,
          getter=areErrorsAsynchronous) BOOL errorsAsynchronous;

Swift

var areErrorsAsynchronous: Bool { get }

disableAssertions

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.

Objective-C

@property (nonatomic, assign, unsafe_unretained, readonly,
          getter=areAssertionsDisabled) BOOL disableAssertions;

Swift

var areAssertionsDisabled: Bool { get }

dateFormatter

Active date formatter

Objective-C

@property (class, nonatomic, strong, readonly) NSDateFormatter *_Nonnull dateFormatter;

Swift

class var dateFormatter: DateFormatter { get }

logQueue

The queue asynchronously logged logs are logged on. Say that 10 times fast.

Objective-C

@property (class, nonatomic, readonly) dispatch_queue_t _Nonnull logQueue;

Swift

unowned(unsafe) class var logQueue: DispatchQueue { get }

+sharedManager

The singleton object

Objective-C

+ (nonnull SDLLogManager *)sharedManager;

Swift

class func shared() -> SDLLogManager

Return Value

The singleton object

+setConfiguration:

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.

Objective-C

+ (void)setConfiguration:(nonnull SDLLogConfiguration *)configuration;

Swift

class func setConfiguration(_ configuration: SDLLogConfiguration)

Parameters

configuration

The configuration to be used.

-setConfiguration:

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.

Objective-C

- (void)setConfiguration:(nonnull SDLLogConfiguration *)configuration;

Swift

func setConfiguration(_ configuration: SDLLogConfiguration)

Parameters

configuration

The configuration to be used.

+logWithLevel:timestamp:file:functionName:line:queue:formatMessage:

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.

Objective-C

+ (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, ...;

Parameters

level

The level of the log

timestamp

The time the log was sent

file

The file the log originated from

functionName

The function the log originated from

line

The line the log originated from

queueLabel

The queue the log was sent from

message

The message of the log with a format

-logWithLevel:timestamp:file:functionName:line:queue:formatMessage:

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.

Objective-C

- (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, ...;

Parameters

level

The level of the log

timestamp

The time the log was sent

file

The file the log originated from

functionName

The function the log originated from

line

The line the log originated from

queueLabel

The queue the log was sent from

message

The message of the log with a format

+logWithLevel:timestamp:file:functionName:line:queue:message:

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.

Objective-C

+ (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;

Swift

class func log(with level: SDLLogLevel, timestamp: Date, file: String, functionName: String, line: Int, queue queueLabel: String, message: String)

Parameters

level

The level of the log

timestamp

The time the log was sent

file

The file the log originated from

functionName

The function the log originated from

line

The line the log originated from

queueLabel

The queue the log was sent from

message

The message of the log

-logWithLevel:timestamp:file:functionName:line:queue:message:

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.

Objective-C

- (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;

Swift

func log(with level: SDLLogLevel, timestamp: Date, file: String, functionName: String, line: Int, queue queueLabel: String, message: String)

Parameters

level

The level of the log

timestamp

The time the log was sent

file

The file the log originated from

functionName

The function the log originated from

line

The line the log originated from

queueLabel

The queue the log was sent from

message

The message of the log

+logBytes:direction:timestamp:file:functionName:line:queue:

Log to this sharedManager’s active log targets. This is used internally to log.

Objective-C

+ (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;

Swift

class func logBytes(_ data: Data, direction: SDLLogBytesDirection, timestamp: Date, file: String, functionName: String, line: Int, queue queueLabel: String)

Parameters

data

The data to be logged

direction

Whether its transmit or receive data

timestamp

The time the log was sent

file

The file the log originated from

functionName

The function the log originated from

line

The line the log originated from

queueLabel

The queue the log was sent from

-logBytes:direction:timestamp:file:functionName:line:queue:

Log to this manager’s active log targets. This is used internally to log.

Objective-C

- (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;

Swift

func logBytes(_ data: Data, direction: SDLLogBytesDirection, timestamp: Date, file: String, functionName: String, line: Int, queue queueLabel: String)

Parameters

data

The data to be logged

direction

Whether its transmit or receive data

timestamp

The time the log was sent

file

The file the log originated from

functionName

The function the log originated from

line

The line the log originated from

queueLabel

The queue the log was sent from

+logAssertWithTimestamp:file:functionName:line:queue:formatMessage:

Log an error to the sharedManager’s active log targets and assert. This is used internally to log.

Objective-C

+ (void)logAssertWithTimestamp:(nonnull NSDate *)timestamp
                          file:(nonnull NSString *)file
                  functionName:(nonnull NSString *)functionName
                          line:(NSInteger)line
                         queue:(nonnull NSString *)queueLabel
                 formatMessage:(nonnull NSString *)message, ...;

Parameters

timestamp

The time the log was sent

file

The file the log originated from

functionName

The function the log originated from

line

The line the log originated from

queueLabel

The queue the log was sent from

message

The message of the log

-logAssertWithTimestamp:file:functionName:line:queue:formatMessage:

Log an error to this manager’s active log targets and assert. This is used internally to log.

Objective-C

- (void)logAssertWithTimestamp:(nonnull NSDate *)timestamp
                          file:(nonnull NSString *)file
                  functionName:(nonnull NSString *)functionName
                          line:(NSInteger)line
                         queue:(nonnull NSString *)queueLabel
                 formatMessage:(nonnull NSString *)message, ...;

Parameters

timestamp

The time the log was sent

file

The file the log originated from

functionName

The function the log originated from

line

The line the log originated from

queueLabel

The queue the log was sent from

message

The message of the log

View on GitHub.com
Previous Section Next Section