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
initfor 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
messageFormatthe message format
messagethe formatted message
levelthe log level
flagthe log flag
contextthe context (if any is defined)
filethe current file
functionthe current function
linethe current code line
tagpotential tag
optionsa bitmask which supports AWSDDLogMessageCopyFile and AWSDDLogMessageCopyFunction.
timestampthe 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
messageFormatthe message format
messageArgsthe message arguments.
levelthe log level
flagthe log flag
contextthe context (if any is defined)
filethe current file
functionthe current function
linethe current code line
tagpotential tag
optionsa bitmask which supports AWSDDLogMessageCopyFile and AWSDDLogMessageCopyFunction.
timestampthe 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
messagethe message
levelthe log level
flagthe log flag
contextthe context (if any is defined)
filethe current file
functionthe current function
linethe current code line
tagpotential tag
optionsa bitmask which supports AWSDDLogMessageCopyFile and AWSDDLogMessageCopyFunction.
timestampthe 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 levelSwift
var level: AWSDDLogLevel { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) AWSDDLogFlag flagSwift
var flag: AWSDDLogFlag { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSInteger contextSwift
var context: Int { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSString *fileSwift
var file: String { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSString *fileNameSwift
var fileName: String { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic, nullable) NSString * functionSwift
var function: String? { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSUInteger lineSwift
var line: UInt { get } -
Deprecated
Use representedObject instead
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic, nullable) id tagSwift
var tag: Any? { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic, nullable) id representedObjectSwift
var representedObject: Any? { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) AWSDDLogMessageOptions optionsSwift
var options: AWSDDLogMessageOptions { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSDate *timestampSwift
var timestamp: Date { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSString *threadIDSwift
var threadID: String { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic, nullable) NSString *threadNameSwift
var threadName: String? { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSString *queueLabelSwift
var queueLabel: String { get } -
Undocumented
Declaration
Objective-C
@property (readonly, nonatomic) NSUInteger qosSwift
var qos: UInt { get }
View on GitHub
Install in Dash
AWSDDLogMessage Class Reference