NSObject

extension NSObject: ClassNameProtocol

Extends the NSObject

print to console (DEBUG only)

  • Print to stdout current class and function names and optional info

    Note

    Printing is enabled by DEBUG constant which is normally absent from release builds.

    Requires

    to be called from a subclass of NSObject

    Declaration

    Swift

    @available(*, deprecated, message: "use printClassAndFunc(\"...\" instead")
    func printClassAndFunc(info inf_: String = "", fnc fnc_: String = #function)
  • Print to stdout current class and function names and optional info

    Note

    Printing is enabled by DEBUG constant which is normally absent from release builds.

    Requires

    to be called from a subclass of NSObject

    Declaration

    Swift

    func printClassAndFunc(_ info: String = "", fnc fnc_: String = #function)
  • Print to stdout current class and function names and optional info

    Note

    This third form is only needed to make the call printClassAndFunc() unambigous when both above forms are present in the code.

    Todo

    remove when the above deprecated form is removed

    Declaration

    Swift

    func printClassAndFunc(_fnc fnc_: String = #function)

log to file log.txt

  • Print to log file current class and function names and optional info

    Requires

    to be called from a subclass of NSObject

    Declaration

    Swift

    @available(*, deprecated, message: "use logClassAndFunc(\"...\" instead")
    func logClassAndFunc(info inf_: String = "", fnc fnc_: String = #function)
  • Print to log file current class and function names and optional info

    Note

    Printing is enabled by DEBUG constant which is normally absent from release builds.

    Requires

    to be called from a subclass of NSObject

    Declaration

    Swift

    func logClassAndFunc(_ info: String = "", fnc fnc_: String = #function)
  • Print to log file current class and function names and optional info

    Note

    This third form is only needed to make the call logClassAndFunc() unambigous when both above forms are present in the code.

    Todo

    remove when the above deprecated form is removed

    Declaration

    Swift

    func logClassAndFunc(_fnc fnc_: String = #function)

supporting functions

  • Return a string containing current class and function names and optional info

    Requires

    to be called from a subclass of NSObject

    Declaration

    Swift

    internal func formatClassAndFunc(info inf_: String = "", fnc fnc_: String = #function) -> String
  • Return dateTimeString with microsecond resolution

    Declaration

    Swift

    internal func dateTimeString() -> String