public SingleThreadLogger(ThreadLoggerType threadLoggerType) { if (!Directory.Exists(".//Logs")) Directory.CreateDirectory(".//Logs"); _logPathName = ".//Logs//" + threadLoggerType + "_" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss")+Guid.NewGuid()+".log"; }
public SingleThreadLogger(ThreadLoggerType threadLoggerType) { String destPath = Program.GetDataPath("Logs"); if (!Directory.Exists(destPath)) Directory.CreateDirectory(destPath); _logPathName = Path.Combine(destPath, string.Format("{0}_{1:yyyy-MM-dd HH-mm-ss}{2}.log", threadLoggerType, DateTime.Now, Guid.NewGuid())); }
//private StreamWriter _streamWriter; public SingleThreadLogger(ThreadLoggerType threadLoggerType) { if (!Directory.Exists(".//Logs")) { Directory.CreateDirectory(".//Logs"); } _logPathName = ".//Logs//" + threadLoggerType + "_" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + Guid.NewGuid() + ".log"; }
private Int32 maxFileSize = 10 * 1024 * 1024; // max. file size in MB public SingleThreadLogger(ThreadLoggerType threadLoggerType, String destPath = "", Boolean reuseLog = false) { if(String.IsNullOrEmpty(destPath)) destPath = Program.GetDataPath("Logs"); if (!Directory.Exists(destPath)) Directory.CreateDirectory(destPath); if(reuseLog) _logPathName = Path.Combine(destPath, string.Format("{0}.log", threadLoggerType)); else _logPathName = Path.Combine(destPath, string.Format("{0}_{1:yyyy-MM-dd HH-mm-ss}.log", threadLoggerType, DateTime.Now)); }
private Int32 maxFileSize = 10 * 1024 * 1024; // max. file size in MB public SingleThreadLogger(ThreadLoggerType threadLoggerType, String destPath = "", Boolean reuseLog = false) { if (String.IsNullOrEmpty(destPath)) { destPath = Program.GetDataPath("Logs"); } if (!Directory.Exists(destPath)) { Directory.CreateDirectory(destPath); } if (reuseLog) { _logPathName = Path.Combine(destPath, string.Format("{0}.log", threadLoggerType)); } else { _logPathName = Path.Combine(destPath, string.Format("{0}_{1:yyyy-MM-dd HH-mm-ss}.log", threadLoggerType, DateTime.UtcNow)); } }