Where to dispose StreamWriter if I need it during entire
application lifetime? I'm going to dispose it in destructor, will
that work? I have to dispose to flush data, and I don't want to use
AutoFlush feature because from msdn:
get better performance by setting AutoFlush to false, assuming that
you always call Close (or at least Flush) when you're done writing
with a StreamWriter."
private static StreamWriter swLog = new StreamWriter("logMAIN.txt");
public static void Push(LogItemType type, string message)
swLog.WriteLine(type + " " + DateTime.Now.TimeOfDay + " " + message);
upd instead of
Dispose i meant to
Close but it is not improtant in this case
because they seems doing exactly the same.