Log
public class Log : NSObject
Trckr Internal logging facility.
To enable Trckr logs, call Log.start()
.
By default, Trckr logs to the console and to a file. This can be disabled with enableConsoleLog
and enableFileLog
respectively. The current log file can be accessed with logFileName
.
Log files are capped at 1MB and are rotated. When a log file is rotated, it is renamed and saved as archive. You can get the archived log file path via didRotateLogFile
closure.
-
Start
Trckr
loggingDeclaration
Swift
public class func start()
-
Should Trckr log to the console, default = true
Declaration
Swift
public static var enableConsoleLog: Bool
-
Should Trckr log to a file, default = true
Declaration
Swift
public static var enableFileLog: Bool
-
The full path to log file that is currently open.
Declaration
Swift
public static var logFileName: String
-
This closure is called when Log file is rotated and saved to
path
. A new log file is created prior to calling this block and logging continues to the new file. Use this to e.g. zip and upload the saved log file to FireBase or other storage for further analysisDeclaration
Swift
public static var didRotateLogFile: ((String) -> Void)?
-
The directory in which rotated log files are stored
Declaration
Swift
public static var archiveDirectory: String { get }