I have this code that generates a log whenever the service is finished, but it may happen that I have unprocessed NF and I need to list it for easy identification.
Example 100 NF were not processed. In this case you are listing everything on the same line instead of breaking.
publicvoidGerarLogoProcessamentoFim(){StreamWriterobjWR=newStreamWriter(processo,true);StringBuilderlinha=newStringBuilder();linha.Append(" --> NF PROCESSADAS: " + processadas);
linha.Append(" --> NF NÃO PROCESSADAS: " + nprocessadas);
if (nprocessadasNumero.Count > 0)
{
for (int i = 0; i < nprocessadasNumero.Count; i++)
{
linha.Append("NF - " + nprocessadasNumero[i]);
}
}
linha.Append(" <-- FINALIZAÇÃO:" + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss"));
objWR.WriteLine(linha.ToString());
objWR.Close();
}