AWSDDLogMessage
Objective-C
@interface AWSDDLogMessage : NSObject <NSCopying> {
NSString *_message;
NSString *_messageFormat;
AWSDDLogLevel _level;
AWSDDLogFlag _flag;
NSInteger _context;
NSString *_file;
NSString *_fileName;
NSString *_function;
NSUInteger _line;
id _tag;
id _representedObject;
AWSDDLogMessageOptions _options;
NSDate *_timestamp;
NSString *_threadID;
NSString *_threadName;
NSString *_queueLabel;
NSUInteger _qos;
}
Swift
class AWSDDLogMessage : NSObject, NSCopying, @unchecked Sendable
The AWSDDLogMessage
class encapsulates information about the log message.
If you write custom loggers or formatters, you will be dealing with objects of this class.
-
Undocumented
Declaration
Objective-C
NSString *_message
-
Undocumented
Declaration
Objective-C
NSString *_messageFormat
-
Undocumented
Declaration
Objective-C
AWSDDLogLevel _level
-
Undocumented
Declaration
Objective-C
AWSDDLogFlag _flag
-
Undocumented
Declaration
Objective-C
NSInteger _context
-
Undocumented
Declaration
Objective-C
NSString *_file
-
Undocumented
Declaration
Objective-C
NSString *_fileName
-
Undocumented
Declaration
Objective-C
NSString *_function
-
Undocumented
Declaration
Objective-C
NSUInteger _line
-
Deprecated
Use _representedObject instead
Undocumented
Declaration
Objective-C
id _tag
-
Undocumented
Declaration
Objective-C
id _representedObject
-
Undocumented
Declaration
Objective-C
AWSDDLogMessageOptions _options
-
Undocumented
Declaration
Objective-C
NSDate * _timestamp
-
Undocumented
Declaration
Objective-C
NSString *_threadID
-
Undocumented
Declaration
Objective-C
NSString *_threadName
-
Undocumented
Declaration
Objective-C
NSString *_queueLabel
-
Undocumented
Declaration
Objective-C
NSUInteger _qos
-
Default
init
for empty messages.Declaration
Objective-C
- (nonnull instancetype)init;
Swift
init()
-
Standard init method for a log message object. Used by the logging primitives. (And the macros use the logging primitives.)
If you find need to manually create logMessage objects, there is one thing you should be aware of:
If no flags are passed, the method expects the file and function parameters to be string literals. That is, it expects the given strings to exist for the duration of the object’s lifetime, and it expects the given strings to be immutable. In other words, it does not copy these strings, it simply points to them. This is due to the fact that FILE and FUNCTION are usually used to specify these parameters, so it makes sense to optimize and skip the unnecessary allocations. However, if you need them to be copied you may use the options parameter to specify this.
Declaration
Objective-C
- (nonnull instancetype)initWithFormat:(nonnull NSString *)messageFormat formatted:(nonnull NSString *)message level:(AWSDDLogLevel)level flag:(AWSDDLogFlag)flag context:(NSInteger)context file:(nonnull NSString *)file function:(nullable NSString *)function line:(NSUInteger)line tag:(nullable id)tag options:(AWSDDLogMessageOptions)options timestamp:(nullable NSDate *)timestamp;
Swift
init(format messageFormat: String, formatted message: String, level: AWSDDLogLevel, flag: AWSDDLogFlag, context: Int, file: String, function: String?, line: UInt, tag: Any?, options: AWSDDLogMessageOptions = [], timestamp: Date?)
Parameters
messageFormat
the message format
message
the formatted message
level
the log level
flag
the log flag
context
the context (if any is defined)
file
the current file
function
the current function
line
the current code line
tag
potential tag
options
a bitmask which supports AWSDDLogMessageCopyFile and AWSDDLogMessageCopyFunction.
timestamp
the log timestamp
Return Value
a new instance of a log message model object
-
Convenience initializer taking a `va_list` as arguments to create the formatted message.
Declaration
Objective-C
- (nonnull instancetype)initWithFormat:(nonnull NSString *)messageFormat args:(struct __va_list_tag *)messageArgs level:(AWSDDLogLevel)level flag:(AWSDDLogFlag)flag context:(NSInteger)context file:(nonnull NSString *)file function:(nullable NSString *)function line:(NSUInteger)line tag:(nullable id)tag options:(AWSDDLogMessageOptions)options timestamp:(nullable NSDate *)timestamp;
Swift
convenience init(format messageFormat: String, args messageArgs: CVaListPointer, level: AWSDDLogLevel, flag: AWSDDLogFlag, context: Int, file: String, function: String?, line: UInt, tag: Any?, options: AWSDDLogMessageOptions = [], timestamp: Date?)
Parameters
messageFormat
the message format
messageArgs
the message arguments.
level
the log level
flag
the log flag
context
the context (if any is defined)
file
the current file
function
the current function
line
the current code line
tag
potential tag
options
a bitmask which supports AWSDDLogMessageCopyFile and AWSDDLogMessageCopyFunction.
timestamp
the log timestamp
Return Value
a new instance of a log message model object
-
Deprecated
Use initializer taking unformatted message and args instead
Deprecated initialier. See initWithFormat:args:formatted:level:flag:context:file:function:line:tag:options:timestamp:.
Declaration
Objective-C
- (nonnull instancetype)initWithMessage:(nonnull NSString *)message level:(AWSDDLogLevel)level flag:(AWSDDLogFlag)flag context:(NSInteger)context file:(nonnull NSString *)file function:(nullable NSString *)function line:(NSUInteger)line tag:(nullable id)tag options:(AWSDDLogMessageOptions)options timestamp:(nullable NSDate *)timestamp;
Swift
convenience init(message: String, level: AWSDDLogLevel, flag: AWSDDLogFlag, context: Int, file: String, function: String?, line: UInt, tag: Any?, options: AWSDDLogMessageOptions = [], timestamp: Date?)
Parameters
message
the message
level
the log level
flag
the log flag
context
the context (if any is defined)
file
the current file
function
the current function
line
the current code line
tag
potential tag
options
a bitmask which supports AWSDDLogMessageCopyFile and AWSDDLogMessageCopyFunction.
timestamp
the log timestamp
Return Value
a new instance of a log message model object
-
The log message.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull message;
Swift
var message: String { get }
-
The message format. When the deprecated initializer is used, this might be the same as
message
.Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull messageFormat;
Swift
var messageFormat: String { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) AWSDDLogLevel level
Swift
var level: AWSDDLogLevel { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) AWSDDLogFlag flag
Swift
var flag: AWSDDLogFlag { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSInteger context
Swift
var context: Int { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSString *file
Swift
var file: String { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSString *fileName
Swift
var fileName: String { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic, nullable) NSString * function
Swift
var function: String? { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSUInteger line
Swift
var line: UInt { get }
-
Deprecated
Use representedObject instead
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic, nullable) id tag
Swift
var tag: Any? { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic, nullable) id representedObject
Swift
var representedObject: Any? { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) AWSDDLogMessageOptions options
Swift
var options: AWSDDLogMessageOptions { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSDate *timestamp
Swift
var timestamp: Date { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSString *threadID
Swift
var threadID: String { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic, nullable) NSString *threadName
Swift
var threadName: String? { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSString *queueLabel
Swift
var queueLabel: String { get }
-
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSUInteger qos
Swift
var qos: UInt { get }