Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

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 (readonly, copy, nonatomic)
    NSSet<SDLLogFileModule *> *_Nonnull modules;

Swift

var modules: Set<AnyHashable> { get }

targets

Active log targets

Objective-C

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

Swift

var targets: Set<AnyHashable> { get }

filters

Active log filters

Objective-C

@property (readonly, copy, nonatomic) 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 (readonly, assign, nonatomic) SDLLogLevel globalLogLevel;

Swift

var globalLogLevel: SDLLogLevel { get }

formatType

Active log format

Objective-C

@property (readonly, assign, nonatomic) 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 (readonly, getter=isAsynchronous, assign, nonatomic) 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 (readonly, getter=areErrorsAsynchronous, assign, nonatomic)
    BOOL errorsAsynchronous;

Swift

var areErrorsAsynchronous: Bool { get }

dateFormatter

Active date formatter

Objective-C

@property (readonly, strong, nonatomic, class)
    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 (readonly, assign, nonatomic, class)
    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

View on GitHub.com
Previous Section Next Section