public static void TestParseLine(string sConfig, string sLine, string sPartitionExpected, string sRowKeyExpected, string sTickCountExpected, string sAppNameExpected, string sLevelExpected, string sEventIDExpected, string sInstanceIDExpected, string sPidExpected, string sTidExpected, string sMessageRawExpected, string sMessage0Expected, string sMessage1Expected, string sMessage2Expected, string sMessage3Expected, string sMessage4Expected, string sMessage5Expected, string sMessage6Expected, string sMessage7Expected, string sMessage8Expected, string sMessage9Expected) { TextLogConverter tlc = TextLogConverter.CreateFromConfig(sConfig); AzLogEntry azle = tlc.ParseLine(sLine, 0); AzLogEntry azleExpected = new AzLogEntry(); azleExpected.InitMessageParts(10); azleExpected.SetColumn(AzLogEntry.LogColumn.Partition, sPartitionExpected); azleExpected.SetColumn(AzLogEntry.LogColumn.RowKey, sRowKeyExpected); azleExpected.SetColumn(AzLogEntry.LogColumn.EventTickCount, sTickCountExpected); azleExpected.SetColumn(AzLogEntry.LogColumn.AppName, sAppNameExpected); azleExpected.SetColumn(AzLogEntry.LogColumn.Level, sLevelExpected); azleExpected.SetColumn(AzLogEntry.LogColumn.EventID, sEventIDExpected); azleExpected.SetColumn(AzLogEntry.LogColumn.InstanceID, sInstanceIDExpected); azleExpected.SetColumn(AzLogEntry.LogColumn.Pid, sPidExpected); azleExpected.SetColumn(AzLogEntry.LogColumn.Tid, sTidExpected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message, sMessageRawExpected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message0, sMessage0Expected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message1, sMessage1Expected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message2, sMessage2Expected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message3, sMessage3Expected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message4, sMessage4Expected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message5, sMessage5Expected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message6, sMessage6Expected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message7, sMessage7Expected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message8, sMessage8Expected); azleExpected.SetColumn(AzLogEntry.LogColumn.Message9, sMessage9Expected); AssertAzleEqual(azle, azleExpected); }
/* A Z L E F R O M L I N E */ /*---------------------------------------------------------------------------- * %%Function: AzleFromLine * %%Qualified: AzLog.AzLogFile.AzleFromLine * %%Contact: rlittle * * We pass in nLine to retain some relationship of ordering to the original * log file. Since we are converting Seconds into TickCounts, the level * of granularity is low. this means the many of the least significant digits * of the tickcount are always zero. * * we can take advantage of that and put the line number into those low digits * and that way log lines that have identical date/time will still get * differentiated by their tickcount. * ----------------------------------------------------------------------------*/ AzLogEntry AzleFromLine(string sLine, int nLine) { return(m_tlc.ParseLine(sLine, nLine)); }