ZDCLogMessage

@interface ZDCLogMessage : NSObject

Ecapsulates detailed information about an emitted log message.

  • Standard init method

    Declaration

    Objective-C

    - (nonnull instancetype)initWithMessage:(nonnull NSString *)message
                                      level:(ZDCLogLevel)level
                                       flag:(ZDCLogFlag)flag
                                       file:(nonnull NSString *)file
                                   function:(nonnull NSString *)function
                                       line:(NSUInteger)line;

    Swift

    init(message: String, level: ZDCLogLevel, flag: ZDCLogFlag, file: String, function: String, line: UInt)
  • The log message. (e.g. foo failed because bar returned 404)

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull message;

    Swift

    var message: String { get }
  • The configured zdcLogLevel of the file from which the log was emitted.

    Declaration

    Objective-C

    @property (readonly, nonatomic) ZDCLogLevel level;

    Swift

    var level: ZDCLogLevel { get }
  • Tells you which flag triggered the log. For example, if flag == ZDCLogFlagError, then this is an error log message, emitted via ZDCLogError()

    Declaration

    Objective-C

    @property (readonly, nonatomic) ZDCLogFlag flag;

    Swift

    var flag: ZDCLogFlag { get }
  • The full filePath (e.g. /Users/alice/code/myproject/ZeroDarkCloud/Managers/ZDCPushManager.m) This comes from __FILE__

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull file;

    Swift

    var file: String { get }
  • The lastPathComponent of the filePath, with the fileExtension removed. (e.g. ZDCPushManager)

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull fileName;

    Swift

    var fileName: String { get }
  • The name of function that triggered the log message. This comes from PRETTY_FUNCTION

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull function;

    Swift

    var function: String { get }
  • The line number within the file. (i.e. location of emitted log message)

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSUInteger line;

    Swift

    var line: UInt { get }