Represents a filter over which SDL logs should be logged
A block that takes in a log model and returns whether or not the log passes the filter and should therefore be logged.
@property (nonatomic, strong, readonly) SDLLogFilterBlock _Nonnull filter;
var filter: SDLLogFilterBlock { get }
Initializer unavailable
- (nonnull instancetype)init;
Create a new filter with a custom filter block. The filter block will take a log model and return a BOOL of pass / fail.
- (nonnull instancetype)initWithCustomFilter:(nonnull SDLLogFilterBlock)filter;
init(customFilter filter: @escaping SDLLogFilterBlock)
The custom filter to be used
An instance of SDLLogFilter
Returns a filter that only allows logs not containing the passed string within their message.
+ (nonnull SDLLogFilter *)filterByDisallowingString:(nonnull NSString *)string
caseSensitive:(BOOL)caseSensitive;
/*not inherited*/ init(byDisallowingString string: String, caseSensitive: Bool)
The string, which, if present in the message of the log, will prevent the log from being logged.
Whether or not string
should be checked as case sensitive against the log’s message.
A filter that may be passed into the logConfiguration
.
Returns a filter that only allows logs containing the passed string within their message.
+ (nonnull SDLLogFilter *)filterByAllowingString:(nonnull NSString *)string
caseSensitive:(BOOL)caseSensitive;
/*not inherited*/ init(byAllowing string: String, caseSensitive: Bool)
The string, which, if present in the message of the log, will allow the log to be logged.
Whether or not string
should be checked as case sensitive against the log’s message.
A filter that may be passed into the logConfiguration
.
Returns a filter that only allows logs not passing the passed regex against their message.
+ (nonnull SDLLogFilter *)filterByDisallowingRegex:
(nonnull NSRegularExpression *)regex;
/*not inherited*/ init(byDisallowingRegex regex: NSRegularExpression)
The regex, which, if it matches the message of the log, will prevent the log from being logged.
A filter that may be passed into the logConfiguration
.
Returns a filter that only allows logs passing the passed regex against their message.
+ (nonnull SDLLogFilter *)filterByAllowingRegex:
(nonnull NSRegularExpression *)regex;
/*not inherited*/ init(byAllowingRegex regex: NSRegularExpression)
The regex, which, if it matches the message of the log, will allow the log to be logged.
A filter that may be passed into the logConfiguration
.
Returns a filter that only allows logs not within the specified file modules to be logged.
+ (nonnull SDLLogFilter *)filterByDisallowingModules:
(nonnull NSSet<NSString *> *)modules;
/*not inherited*/ init(byDisallowingModules modules: Set<String>)
A set of module names. If any match, they will not be logged.
A filter that may be passed into the logConfiguration
.
Returns a filter that only allows logs of the specified file modules to be logged.
+ (nonnull SDLLogFilter *)filterByAllowingModules:
(nonnull NSSet<NSString *> *)modules;
/*not inherited*/ init(byAllowingModules modules: Set<String>)
A set of module names. If any match, they will not be logged.
A filter that may be passed into the logConfiguration
.
Returns a filter that only allows logs not within the specified files to be logged.
+ (nonnull SDLLogFilter *)filterByDisallowingFileNames:
(nonnull NSSet<NSString *> *)fileNames;
/*not inherited*/ init(byDisallowingFileNames fileNames: Set<String>)
If a log matches any of the passed files, the log will not be logged.
A filter that may be passed into the logConfiguration
.
Returns a filter that only allows logs within the specified files to be logged.
+ (nonnull SDLLogFilter *)filterByAllowingFileNames:
(nonnull NSSet<NSString *> *)fileNames;
/*not inherited*/ init(byAllowingFileNames fileNames: Set<String>)
If a log matches any of the passed files, the log will be logged.
A filter that may be passed into the logConfiguration
.