profile
viewpoint

Ask questionsTag [DDLogFileManagerDefault initWithLogsDirectory:defaultFileProtectionLevel:] with NS_DESIGNATED_INITIALIZER

DDFileManagerDefault class is not fully configurable if subclassed as there's no straightforward way to change _defaultLogFileProtectionType value because convenience initialisers cannot be called from any subclass initialisers unless automatically inherited which makes subclassing unnecessarily restrictive.

A designated initializer fully initializes all properties introduced by that class and calls an appropriate superclass initializer to continue the initialization process up the superclass chain.

https://github.com/CocoaLumberjack/CocoaLumberjack/blob/48c2b965155c8c0158f2a77837c21d464ca47029/Sources/CocoaLumberjack/DDFileLogger.m#L103

Impact on existing Swift code

  1. If there's no subclassing to DDLogFileManagerDefault, no change is required – both initialisers will continue to work as before.
  2. If a subclass overrides [DDLogFileManagerDefault initWithLogsDirectory:] and makes use of the automatically inherited convenience initialiser [DDLogFileManagerDefault initWithLogsDirectory:defaultFileProtectionLevel:], now a straightforward override will be required to continue using [DDLogFileManagerDefault initWithLogsDirectory:defaultFileProtectionLevel:]. [CocoaLumberjackChange.zip]

Example project that demonstrates the problems is attached (https://github.com/CocoaLumberjack/CocoaLumberjack/files/5555027/CocoaLumberjackChange.zip) This is linked against CocoaLumberjack 3.7.0.

CocoaLumberjack/CocoaLumberjack

Answer questions stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List