I want all Console.WriteLine
to be this way when it is sent to the Console:
[10: 38: 12: 758] - Message typed in WriteLine
Well I've done a part that is this:
private static DateTime data = DateTime.Now;
Console.WriteLine("[{0}]", data.ToString("HH:mm:ss:fff"));
However, I want to write several messages, and in the case I would have to enter this code a lot of times, I wanted it to be something like this:
"CW (" Message ")" and already appeared "DateTime now" in the format I mentioned above, how can I do this?
I made this code:
public void msg(string mensagem)
{
mensagem = "";
Console.WriteLine("[{0}], [{1}]", data.ToString("HH:mm:ss:fff"), mensagem);
}
private void button1_Click(object sender, EventArgs e)
{
msg("Teste");
}
However, the message "Test" does not appear