Esempio n. 1
0
		private static string _formatLogMSG(SAFLOGGER.LOGGEREventID loggerEventID, string appBASEid, string[] appMSGtext)
		{
			Process _thisProc = null;
			string result;
			try
			{
				_thisProc = Process.GetCurrentProcess();
				result = string.Format("{0} [{1}] [{2}]", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), loggerEventID.ToString(), _thisProc.ProcessName) + " " + string.Join(" ", appMSGtext) + ((loggerEventID == SAFLOGGER.LOGGEREventID.EXCEPTION) ? string.Concat(new string[]
				{
					Environment.NewLine,
					SAFLOGGER._getMachineInfo(2)[0],
					Environment.NewLine,
					SAFLOGGER._getMachineInfo(2)[1],
					Environment.NewLine
				}) : "");
			}
			catch
			{
				result = "... [ unable to format message ] ...";
			}
			finally
			{
				if (_thisProc != null)
				{
					_thisProc.Dispose();
				}
				_thisProc = null;
			}
			return result;
		}