elvishew/xLog

Will it cause performance impact when writing file log use default FilePrinter?

evilfate opened this issue · 2 comments

As title, we have some concern about performance impact.

@evilfate It depends on how often you print an log. The default FilePrinter just write the log to the file and flush immediately, so if you print a lot of logs in your release app, I think it would impact the performance.
From my test and general usage, I think it's OK.
If you finally find writing file log impact the performance, you'd better implement you printer, not flush the file every time right after writing the log to the file.

Optimise the FilePrinter, print to file asynchronously.