DaveWoodCom / XCGLogger

A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to generate files and write them the first time you debug?

SF-Simon opened this issue · comments

Every time you start the app, a TXT will be generated, but there may be no printed information except the environment information.

So I wonder if there is a way to generate a TXT file and input relevant information after the first print information?

Yes.

Check out the Advanced Usage section of the ReadMe. You'll see the recommended way to add your log destinations. Also you'll see that the logAppDetails() method is what outputs the environment information. If you alter the order a bit, you can call logAppDetails() before adding the file destination. That will prevent the generic info from being written to the file. If you then want it to be written later, you can call logAppDetails() again and it will only write to destinations it hasn't already written to.