I am writing logger for my embedded application. I need to write all logs to file. Currently I am opening and closing file for every write.
To improve performance, is it safe to keep log file open throughout the application scope and call fflush() without closing file for every write ?