It depends on how many magazines you make. How many logs takes a second, about how much data, how important logs are, etc. If you just added something to the file a couple of times a minute, if this does not happen on the main thread and slows down other things, you are probably fine. If you need to implement something more efficient, you may need simple caching.
You can save the log data cache in memory and save it in a file when it reaches a certain size (every 100 lines) or when a certain amount of time passes (every 5 minutes).
If you take this approach, be sure to override onPause and onDestroy and remember to write the cached log data to a file before exiting the application if the user does not return.
source share