BFLog

public struct BFLog

The private BFLogClass created to manage the log strings.

  • Exenteds NSLog.

    Activate it by setting BFLogActive variable to true before using it.

    Declaration

    Swift

    public static func log(_ message: String, filename: String = #file, function: StaticString = #function, line: Int = #line)

    Parameters

    message

    Console message.

    filename

    File. Default is #file.

    function

    Function name. Default is #function.

    line

    Line number. Default is #line.

  • Exenteds NSLog with a warning sign.

    Activate it by setting BFLogActive variable to true before using it.

    Declaration

    Swift

    public static func warning(_ message: String, filename: String = #file, function: StaticString = #function, line: Int = #line)

    Parameters

    message

    Console message.

    filename

    File. Default is #file.

    function

    Function name. Default is #function.

    line

    Line number. Default is #line.

  • Exenteds NSLog with an error sign.

    Activate it by setting BFLogActive variable to true before using it.

    Declaration

    Swift

    public static func error(_ message: String, filename: String = #file, function: StaticString = #function, line: Int = #line)

    Parameters

    message

    Console message.

    filename

    File. Default is #file.

    function

    Function name. Default is #function.

    line

    Line number. Default is #line.

  • Exenteds NSLog with a debug sign.

    Activate it by setting BFLogActive variable to true before using it.

    Declaration

    Swift

    public static func debug(_ message: String, filename: String = #file, function: StaticString = #function, line: Int = #line)

    Parameters

    message

    Console message.

    filename

    File. Default is #file.

    function

    Function name. Default is #function.

    line

    Line number. Default is #line.

  • Exenteds NSLog with an info sign.

    Activate it by setting BFLogActive variable to true before using it.

    Declaration

    Swift

    public static func info(_ message: String, filename: String = #file, function: StaticString = #function, line: Int = #line)

    Parameters

    message

    Console message.

    filename

    File. Default is #file.

    function

    Function name. Default is #function.

    line

    Line number. Default is #line.

  • Clear the log string.

    Declaration

    Swift

    public static func clear()
  • Save the Log in a file.

    Throws

    write(toFile:, atomically:, encoding:) errors.

    Declaration

    Swift

    public static func saveLog(in path: FileManager.PathType, filename: String) throws

    Parameters

    path

    Save path.

    filename

    Log filename.