public static void LogThis(string logtext, eloglevel loglevel, elogprefix logprefix) { if (m_DefaultToPrimaryProfile) { LogThis(elogprofile.primary, logtext, loglevel, logprefix); } else //log to current profile { m_LogMethods.LogThis(logtext, loglevel, logprefix); } }
public void LogThis(string logtext, eloglevel loglevel, elogprefix logprefix) { if (m_loglevel >= loglevel) { string sFilePath = LogPath; if (sFilePath == "") { SetLogPath(); sFilePath = LogPath; } TruncateLogFile(sFilePath); DateTime dt = DateTime.Now; switch (logprefix) { case elogprefix.dt: logtext = dt.ToString("yyyy.MM.dd") + "-" + dt.ToString("hh.mm.ss") + ": " + logtext; break; case elogprefix.loglevel: logtext = loglevel.ToString() + ": " + logtext; break; case elogprefix.dt_loglevel: logtext = dt.ToString("yyyy.MM.dd") + "-" + dt.ToString("hh.mm.ss") + ":" + loglevel + ": " + logtext; break; } //log it switch (m_logwhere) { case elogwhere.file_and_console: LogConsole(logtext); AppendToFile(sFilePath, logtext); break; case elogwhere.file: AppendToFile(sFilePath, logtext); break; case elogwhere.eventlog: LogEvent(logtext, loglevel); break; case elogwhere.eventlog_and_file: AppendToFile(sFilePath, logtext); LogEvent(logtext, loglevel); break; } } }
public static void LogThis(elogprofile logprofile, string logtext, eloglevel loglevel, elogprefix logprefix) { ((LogMethods)m_Logs[Convert.ToString(logprofile)]).LogThis(logtext, loglevel, logprefix); }
public void LogThis(string logtext,eloglevel loglevel, elogprefix logprefix) { if (m_loglevel >= loglevel) { string sFilePath = LogPath; if (sFilePath == "" ) { SetLogPath(); sFilePath = LogPath; } TruncateLogFile(sFilePath); DateTime dt = DateTime.Now; switch (logprefix) { case elogprefix.dt: logtext = dt.ToString("yyyy.MM.dd") + "-" + dt.ToString("hh.mm.ss") + ": " + logtext; break; case elogprefix.loglevel: logtext = loglevel.ToString() + ": " + logtext; break; case elogprefix.dt_loglevel: logtext = dt.ToString("yyyy.MM.dd") + "-" + dt.ToString("hh.mm.ss") + ":" + loglevel + ": " + logtext; break; } //log it switch (m_logwhere) { case elogwhere.file: AppendToFile(sFilePath,logtext); break; case elogwhere.eventlog: LogEvent(logtext,loglevel); break; case elogwhere.eventlog_and_file: AppendToFile(sFilePath,logtext); LogEvent(logtext,loglevel); break; } } }
public static void LogThis(string logtext,eloglevel loglevel, elogprefix logprefix) { if (m_DefaultToPrimaryProfile) { LogThis(elogprofile.primary,logtext,loglevel,logprefix); } else //log to current profile { m_LogMethods.LogThis(logtext,loglevel, logprefix); } }
public static void LogThis(elogprofile logprofile, string logtext,eloglevel loglevel, elogprefix logprefix) { ((LogMethods)m_Logs[Convert.ToString(logprofile)]).LogThis(logtext,loglevel,logprefix); }