exilon / QuickLogger

Powerful and flexible library for logging on files, console, memory, email, rest, eventlog, syslog, slack, telegram, redis, logstash, elasticsearch, influxdb, graylog, Sentry, Twilio, ide debug messages and throw events for Delphi/Firemonkey/freepascal/.NET (Windows/Linux/OSX/IOS/Android).
Apache License 2.0
381 stars 84 forks source link

TLogFileProvider.WriteToStream AutoFlush check #113

Closed avpnvpn closed 3 weeks ago

avpnvpn commented 4 months ago
TLogFileProvider.WriteToStream:
  if not fAutoFlush then fLogWriter.Flush;

Should it be this? if fAutoFlush then fLogWriter.Flush;

exilon commented 4 months ago

No, only for file provider. AutoFlush = True means writes to file are controlled by OS, Autoflush = False means writes to disk occurs on every new log line (more agressive) If your application is critical and you don't want to lost any log line when your app crashes and log is not flushed fully to disk, you must set it to False. But I recommend use AutoFlush because is less agressive and better performance.