MBModuleLog Class Reference

Inherits from NSObject
Conforms to MBModuleLogRecorder
Declared in MBModuleLog.h

Overview

Instances of this class are used to issue log messages associated with a given MBModule.

MBModuleLogRecorder support

+ setLogRecorderClass:

Sets the logger class used to log messages through MBModuleLog. By default, MBModuleLog is the logger class, unless overridden by a call to this method.

+ (void)setLogRecorderClass:(nullable Class<MBModuleLogRecorder>)logRecorderClass

Parameters

logRecorderClass

The Class implementing MBModuleLogRecorder that should be used as the logger. If nil is passed, the value is reset to the default of MBModuleLog.

Declared In

MBModuleLog.h

+ logRecorderClass

Returns the logger class used to log messages through MBModuleLog.

+ (nonnull Class<MBModuleLogRecorder>)logRecorderClass

Declared In

MBModuleLog.h

Object lifecycle

+ logForModuleClass:

Creates and returns a new MBModuleLog instance for the specified module implementation class.

+ (nonnull instancetype)logForModuleClass:(nonnull Class)moduleCls

Parameters

moduleCls

The implementing class of the MBModule for which a log is being created.

Return Value

A new MBModuleLog.

Discussion

Note: This method is intended to be used only by MBModule implementations themselves. To retrieve the MBModuleLog for a given module, acquire it from the module itself.

Declared In

MBModuleLog.h

+ logForModule:

Creates and returns a new MBModuleLog instance for the specified module.

+ (nonnull instancetype)logForModule:(nonnull NSObject<MBModule> *)module

Parameters

module

The MBModule for which a log is being created.

Return Value

A new MBModuleLog.

Discussion

Note: This method is intended to be used only by MBModule implementations themselves. To retrieve the MBModuleLog for a given module, acquire it from the module itself.

Declared In

MBModuleLog.h

Warnings & Errors

– issueDeprecationWarning:

Issues a deprecation warning from the module associated with the receiver.

- (void)issueDeprecationWarning:(nonnull NSString *)warning

Parameters

warning

The warning message.

Discussion

Note: The warning will be written to the console, possibly asynchronously. Repeated issuances of the same warning may be squelched.

Declared In

MBModuleLog.h

– issueDeprecationWarningWithFormat:

Issues a deprecation warning from the module associated with the receiver.

- (void)issueDeprecationWarningWithFormat:(nonnull NSString *)format, ...

Parameters

format

The format for the warning message, followed by zero or more format parameters.

...

A variable argument list of zero or more values referenced within the format string.

Discussion

Note: The warning will be written to the console, possibly asynchronously. Repeated issuances of the same warning may be squelched.

Declared In

MBModuleLog.h

– issueNotSupportedError:

Issues a not supported error from the module associated with the receiver.

- (void)issueNotSupportedError:(nonnull NSString *)error

Parameters

error

The error message.

Discussion

Note: The error will be written to the console, possibly asynchronously. Repeated issuances of the same error may be squelched.

Declared In

MBModuleLog.h

– issueNotSupportedErrorWithFormat:

Issues a not supported error from the module associated with the receiver.

- (void)issueNotSupportedErrorWithFormat:(nonnull NSString *)format, ...

Parameters

format

The format for the error message, followed by zero or more format parameters.

...

A variable argument list of zero or more values referenced within the format string.

Discussion

Note: The error will be written to the console, possibly asynchronously. Repeated issuances of the same error may be squelched.

Declared In

MBModuleLog.h