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.
The name of the this module, e.g. “Transport”
@property (nonatomic, copy, readonly) NSString *_Nonnull name;
var name: String { get }
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.
@property (nonatomic, copy, readonly) NSSet<NSString *> *_Nonnull files;
var files: Set<String> { get }
The custom level of the log. This is SDLLogLevelDefault
(whatever the current global log level is) by default.
@property (nonatomic) SDLLogLevel logLevel;
var logLevel: SDLLogLevel { get set }
This method is unavailable and may not be used.
- (nonnull instancetype)init;
Always returns nil
Returns an initialized SDLLogFileModule
that contains a custom name, set of files, and associated log level.
- (nonnull instancetype)initWithName:(nonnull NSString *)name
files:(nonnull NSSet<NSString *> *)files
level:(SDLLogLevel)level;
init(name: String, files: Set<String>, level: SDLLogLevel)
The name of this module. This will be used when printing a formatted log for a file within this module e.g. “Transport”.
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.
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.
An initialized SDLLogFileModule
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
.
- (nonnull instancetype)initWithName:(nonnull NSString *)name
files:(nonnull NSSet<NSString *> *)files;
convenience init(name: String, files: Set<String>)
The name of this module. This will be used when printing a formatted log for a file within this module e.g. “Transport”.
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.
An initialized SDLLogFileModule
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
.
+ (nonnull instancetype)moduleWithName:(nonnull NSString *)name
files:(nonnull NSSet<NSString *> *)files;
The name of this module. This will be used when printing a formatted log for a file within this module e.g. “Transport”.
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.
An initialized SDLLogFileModule
Returns whether or not this module contains a given file.
- (BOOL)containsFile:(nonnull NSString *)fileName;
func containsFile(_ fileName: String) -> Bool
The file name to check
A BOOL, YES if this module contains the given file.