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
SDLLogFileModule

SDLLogFileModule Class Reference

Section Contents

Overview

A log file module is a collection of source code files that form a cohesive unit and that logs can all use to describe themselves. E.g. a “transport” module, or a “Screen Manager” module.

name

The name of the this module, e.g. “Transport”

Objective-C

@property (nonatomic, copy, readonly) NSString *_Nonnull name;

Swift

var name: String { get }

files

All of the files contained within this module. When a log is logged, the __FILE__ (in Obj-C) or #file (in Swift) is automatically captured and checked to see if any module has a file in this set that matches. If it does, it will be logged using the module’s log level and the module’s name will be printed in the formatted log.

Objective-C

@property (nonatomic, copy, readonly) NSSet<NSString *> *_Nonnull files;

Swift

var files: Set<String> { get }

logLevel

The custom level of the log. This is SDLLogLevelDefault (whatever the current global log level is) by default.

Objective-C

@property (nonatomic) SDLLogLevel logLevel;

Swift

var logLevel: SDLLogLevel { get set }

-init

This method is unavailable and may not be used.

Objective-C

- (nonnull instancetype)init;

Return Value

Always returns nil

-initWithName:files:level:

Returns an initialized SDLLogFileModule that contains a custom name, set of files, and associated log level.

Objective-C

- (nonnull instancetype)initWithName:(nonnull NSString *)name
                               files:(nonnull NSSet<NSString *> *)files
                               level:(SDLLogLevel)level;

Swift

init(name: String, files: Set<String>, level: SDLLogLevel)

Parameters

name

The name of this module. This will be used when printing a formatted log for a file within this module e.g. “Transport”.

files

The files this module covers. This should correspond to a __FILE__ or #file call for use when comparing a log to this module. Any log originating in a file contained in this set will then use this module’s log level and print the module name.

level

The custom logging level logs originating in files contained in this log module will use. For example, if the global level is SDLLogLevelError and this module is configured to SDLLogLevelVerbose, all logs originating from files within this module will be logged, not merely error logs.

Return Value

An initialized SDLLogFileModule

-initWithName:files:

Returns an initialized SDLLogFileModule that contains a custom name and set of files. The logging level is the same as the current global logging file by using SDLLogLevelDefault.

Objective-C

- (nonnull instancetype)initWithName:(nonnull NSString *)name
                               files:(nonnull NSSet<NSString *> *)files;

Swift

convenience init(name: String, files: Set<String>)

Parameters

name

The name of this module. This will be used when printing a formatted log for a file within this module e.g. “Transport”.

files

The files this module covers. This should correspond to a __FILE__ or #file call for use when comparing a log to this module. Any log originating in a file contained in this set will then use this module’s log level and print the module name.

Return Value

An initialized SDLLogFileModule

+moduleWithName:files:

Returns an initialized SDLLogFileModule that contains a custom name and set of files. The logging level is the same as the current global logging file by using SDLLogLevelDefault.

Objective-C

+ (nonnull instancetype)moduleWithName:(nonnull NSString *)name
                                 files:(nonnull NSSet<NSString *> *)files;

Parameters

name

The name of this module. This will be used when printing a formatted log for a file within this module e.g. “Transport”.

files

The files this module covers. This should correspond to a __FILE__ or #file call for use when comparing a log to this module. Any log originating in a file contained in this set will then use this module’s log level and print the module name.

Return Value

An initialized SDLLogFileModule

-containsFile:

Returns whether or not this module contains a given file.

Objective-C

- (BOOL)containsFile:(nonnull NSString *)fileName;

Swift

func containsFile(_ fileName: String) -> Bool

Parameters

fileName

The file name to check

Return Value

A BOOL, YES if this module contains the given file.

View on GitHub.com
Previous Section Next Section