DDOSLogger

Objective-C


@interface DDOSLogger : DDAbstractLogger <DDLogger>

Swift

class DDOSLogger : DDAbstractLogger, DDLogger

This class provides a logger for the Apple os_log facility.

  • Singleton method

    Declaration

    Objective-C

    @property (class, nonatomic, strong, readonly) DDOSLogger *_Nonnull sharedInstance;

    Swift

    class var sharedInstance: DDOSLogger { get }

    Return Value

    the shared instance with OS_LOG_DEFAULT.

  • Designated initializer

    @discussion This method requires either both or no parameter to be set. Much like (String, String)? in Swift. If both parameters are nil, this method will return a logger configured with OS_LOG_DEFAULT. If both parameters are non-nil, it will return a logger configured with os_log_create(subsystem, category)

    Declaration

    Objective-C

    - (nonnull instancetype)initWithSubsystem:(nullable NSString *)subsystem
                                     category:(nullable NSString *)category;

    Swift

    init(subsystem: String?, category: String?)

    Parameters

    subsystem

    Desired subsystem in log. E.g. “org.example”

    category

    Desired category in log. E.g. “Point of interests.”

    Return Value

    New instance of DDOSLogger.