ARTInternalLog
Objective-C
@interface ARTInternalLog: NSObject
#endif
/**
Provides a shared logger to be used by all public class methods meeting the following criteria:
- they wish to perform logging
- they do not have access to any more appropriate logger
- their signature is already locked since they are part of the public API of the library
Currently, this returns a logger that will not actually output any log messages, but I’ve created https://github.com/ably/ably-cocoa/issues/1652 for us to revisit this.
*/
@property (nonatomic, readonly, class) ARTInternalLog *sharedClassMethodLogger_readDocumentationBeforeUsing;
/**
Creates a logger which forwards its generated messages to the given core object.
*/
- (instancetype)initWithCore:(id<ARTInternalLogCore>)core NS_DESIGNATED_INITIALIZER;
/**
A convenience initializer which creates a logger whose core is an instance of `ARTDefaultInternalLogCore` wrapping the given logger.
*/
- (instancetype)initWithLogger:(id<ARTVersion2Log>)logger;
/**
A convenience initializer which creates a logger whose core is an instance of `ARTDefaultInternalLogCore` initialized with that class’s `initWithClientOptions:` initializer.
*/
- (instancetype)initWithClientOptions:(ARTClientOptions *)clientOptions;
- (instancetype)init NS_UNAVAILABLE;
/**
Passes the arguments through to the logger’s core object.
It is not directly used by the internals of the `Ably` library, but it is used by:
- some of our Swift tests (which can’t access the variadic method below), which want to be able to call a logging method on an instance of `ARTInternalLog`
- `ARTPluginAPI`, to implement its conformance to the `APPluginAPIProtocol` protocol, which is used by plugins written in Swift
*/
- (void)log:(NSString *)message withLevel:(ARTLogLevel)level file:(const char *)fileName line:(NSInteger)line;
// This method should not be called directly — it is for use by the ARTLog* macros. It is tested via the tests of the macros.
- (void)logWithLevel:(ARTLogLevel)level file:(const char *)fileName line:(NSUInteger)line format:(NSString *)format, ... NS_FORMAT_FUNCTION(4,5);
@property (nonatomic) ARTLogLevel logLevel;
@end
Swift
class InternalLog : NSObject
Undocumented
-
Provides a shared logger to be used by all public class methods meeting the following criteria:
- they wish to perform logging
- they do not have access to any more appropriate logger
- their signature is already locked since they are part of the public API of the library
Currently, this returns a logger that will not actually output any log messages, but I’ve created https://github.com/ably/ably-cocoa/issues/1652 for us to revisit this.
Declaration
Objective-C
@property (class, nonatomic, readonly) ARTInternalLog *_Nonnull sharedClassMethodLogger_readDocumentationBeforeUsing;
Swift
class var sharedClassMethodLogger_readDocumentationBeforeUsing: InternalLog { get }
-
Creates a logger which forwards its generated messages to the given core object.
Declaration
Objective-C
- (nonnull instancetype)initWithCore:(nonnull id<ARTInternalLogCore>)core;
Swift
init(core: any InternalLogCore)
-
A convenience initializer which creates a logger whose core is an instance of
ARTDefaultInternalLogCore
wrapping the given logger.Declaration
Objective-C
- (nonnull instancetype)initWithLogger:(nonnull id<ARTVersion2Log>)logger;
Swift
convenience init(logger: any Version2Log)
-
A convenience initializer which creates a logger whose core is an instance of
ARTDefaultInternalLogCore
initialized with that class’sinitWithClientOptions:
initializer.Declaration
Objective-C
- (nonnull instancetype)initWithClientOptions: (nonnull ARTClientOptions *)clientOptions;
Swift
convenience init(clientOptions: ARTClientOptions)
-
Unavailable
Undocumented
Declaration
Objective-C
- (instancetype)init NS_UNAVAILABLE;
-
Passes the arguments through to the logger’s core object.
It is not directly used by the internals of the
Ably
library, but it is used by:- some of our Swift tests (which can’t access the variadic method below), which want to be able to call a logging method on an instance of
ARTInternalLog
-
ARTPluginAPI
, to implement its conformance to theAPPluginAPIProtocol
protocol, which is used by plugins written in Swift
Declaration
Objective-C
- (void)log:(nonnull NSString *)message withLevel:(ARTLogLevel)level file:(nonnull const char *)fileName line:(NSInteger)line;
Swift
func log(_ message: String, with level: ARTLogLevel, file fileName: UnsafePointer<CChar>, line: Int)
- some of our Swift tests (which can’t access the variadic method below), which want to be able to call a logging method on an instance of
-
Undocumented
Declaration
Objective-C
- (void)logWithLevel:(ARTLogLevel)level file:(const char *)fileName line:(NSUInteger)line format:(NSString *)format, ... NS_FORMAT_FUNCTION(4,5);
-
Undocumented
Declaration
Objective-C
@property (nonatomic) ARTLogLevel logLevel
Swift
var logLevel: ARTLogLevel { get set }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) id<ARTInternalLogCore> core
Swift
var core: any InternalLogCore { get }