Setting of Traces for Diagnostics.Debug

nick5454nick5454 ✭✭✭USUniversity ✭✭✭

I switched from Console.WriteLine to System.Diagnostics.Debug.WriteLine so I can use different categories to switch debugging on and off since in our project we have a ton of logging.

In Visual Studio usually there is a config to add tracing output, how do I do this in a xamarin.ios project?

Posts

  • MarkSmith.8123MarkSmith.8123 Xamurai USXamarin Team, University, XamUProfessors Xamurai

    Hi @nick5454‌,

    As far as I know, this is not supported in Mono. The Debug.WriteLine does not have a category to associate. If you have the #DEBUG symbol defined, it's printed to the output log, if you don't - it's not.

    Trace.WriteLine and System.Configuration is the API that has a category, and it's not present/available. Perhaps you can check into a 3rd party logger like log4net, or roll your own simple framework with a trace listener so you can control the output?

    Best of luck!
    Mark Smith

Sign In or Register to comment.