简体   繁体   中英

Xamarin Android Output redundancy in Visual Studio

I have this code in visual studio on my Xamarin android Project:

Console.WriteLine(string.Join("\n", barcodes));

barcodes is a List and I logically want this output:

5099924337427
4053804309851

and I get this:

5099924337427
08-24 13:44:24.883 I/mono-stdout(21154): 5099924337427
4053804309851
08-24 13:44:24.884 I/mono-stdout(21154): 4053804309851

Everytime I write output the messages is doubled. Is there a Way to get rid of the mono-stdout line?

EDITED : Alright after some tests :

  • Console.WriteLine print twice the message, one with time header
  • Android.Util.Log.Debug print the message with a time header, a custom header and your message

    ex > 01-01 04:44:10.379 D/[Dashboard][INFO] ( 3291): Hello!

  • Trace.WriteLine print the message with a quite smaller header, a custom header, and your message.

    ex > [0:] [Dashboard][INFO] : Hello!

On above examples "[Dashboard][INFO]" is my custom header, "Hello!" is my message. If you do not want any custom header, just use String.Empty.

Test out and pick your favorite !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM