1

I am trying to use Log.Info for Debugging. I have found a very large limitation, It appears that it can only display - Log.Info(tag, "this is an info message"); Notice 2 static strings

if the call looks line this -

Log.Info(tag, MyClass.Property.ToString());

or

Log.Info(tag, "MyValue is =" + MyClass.Property.ToString());

or

string a = "AA";
Log.Info(tag, a);

All of these will blow up the program and not display or track in the Logger. Is there a better way? How can I track var values?

Also as an after thought How can I clear the Log?

Thanks

Ritch Melton
  • 11,498
  • 4
  • 41
  • 54
Cadwell55
  • 71
  • 2

2 Answers2

0

I don't think Log.Info is broken.... But here are some alternatives when debugging:

Debug.WriteLine();
Trace.WriteLine();
Console.WriteLine();
c0deNinja
  • 3,956
  • 1
  • 29
  • 45
  • Since run in debugger never returns for me, I am trying to debug in run-without debug. Therefor these ideas, even though they are good, will not work for me. – Cadwell55 Nov 04 '11 at 22:03
  • @Cadwell55: What do you mean by _"run in debugger never returns"_? You should try to solve this before trying to bypass the problem (the source of your problem can be the same). Check this link if you have the same problem: http://stackoverflow.com/questions/7078508/debug-writeline-is-not-hit – Otiel Nov 05 '11 at 00:09
0

Where are you looking for the messages? They should show up in logcat:

http://docs.xamarin.com/android/advanced_topics/android_debug_log

If the messages themselves are dying, you should see an exception message of why also in logcat.

jpobst
  • 9,982
  • 1
  • 29
  • 33