You can easily create a log file from the print statement in the project without changing print or anything else.
Simply add the following line to your Podfile:
pod 'ConsoleLogFile'
import ConsoleLogFile
ConsoleLogFile.shared.createLog()
ConsoleLogFile.shared.shareFile(viewController: self)
- fileName: change log file name (default value is 'Console')
- maxFileSizeInMB: if file size reach to max then it will be deleted (default value 5 MB)
- shouldOverrideOldFile: if true then every time ConsoleLogFile.shared.createLog() execute it will override
ConsoleLogFile.shared.createLog(fileName: "Debug", maxFileSizeInMB: 10, shouldOverrideOldFile: true)
- Use REST API to enable/disable log file creation
Jignesh, [email protected]
ConsoleLogFile is available under the MIT license. See the LICENSE file for more info.