Bug 58857 - Allow developers to change the MONO_LOG_LEVEL value through project options.
Summary: Allow developers to change the MONO_LOG_LEVEL value through project options.
Status: RESOLVED ANSWERED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android (show other bugs)
Version: 4.6.0 (15.3)
Hardware: PC Windows
: Normal enhancement
Target Milestone: 15.6
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-17 17:50 UTC by Jon Douglas [MSFT]
Modified: 2017-10-06 01:21 UTC (History)
6 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Jon Douglas [MSFT] 2017-08-17 17:50:39 UTC
*Description:

In iOS and Android projects, there is a default Mono log level that is set implicitly. This level I believe is currently "info" which can be quite chatty and scare developers into thinking something has gone wrong when running their application and viewing the output. This is controlled by Mono logging trace level:

http://www.mono-project.com/docs/advanced/runtime/logging-runtime-events/#trace-levels

This feature request hopes to outline the need for a GUI property that can be set in both a Xamarin.Android and Xamarin.iOS project in which one can change the respective Mono Log Level via a dropdown UI element in the project options with the values of:

Error
Critical
Warning
Message
Info
Debug

Here is the command line help snippet for MONO_LOG_LEVEL - http://docs.go-mono.com/?link=man%3amono(1)

      The MONO_LOG_LEVEL environment variable if set, the  logging  level  is
      changed  to  the  set  value.  Possible values are "error", "critical",
      "warning", "message", "info", "debug". The default  value  is  "error".
      Messages  with  a  logging level greater then or equal to the log level
      will be printed to stdout/stderr.

      Use "info" to track the dynamic loading of assemblies.

The reasoning behind this item is that this will help developers set these values(instead of having them do it via environment files and build actions), and also allow the developer to experiment with the value for their project's needs. 

It would also be helpful if each value has a description of what type of logging you will respectfully receive.

*Xamarin.Android:

How to set - https://developer.xamarin.com/guides/android/advanced_topics/environment/

EX:

If `MONO_LOG_LEVEL=info` is set, the `G_LOG_LEVEL_INFO` messages from the mono runtime get mapped to Android's *debug* level and you will see it as `D/Mono` in logcat.

https://github.com/mono/mono/blob/master/mono/utils/mono-log-android.c#L61

*Xamarin.iOS:

How to set - https://developer.xamarin.com/guides/ios/advanced_topics/environment/#Permanent_environment_variables

*Related Enhancements/Bugs:

https://bugzilla.xamarin.com/show_bug.cgi?id=7249

https://bugzilla.xamarin.com/show_bug.cgi?id=13538

https://bugzilla.xamarin.com/show_bug.cgi?id=58829

https://bugzilla.xamarin.com/show_bug.cgi?id=42933
Comment 2 Pierce Boggan [MSFT] 2017-09-13 20:58:13 UTC
Tentatively moving this feature work to 15.6. We will create an associated work item for tracking in VSTS when we begin work on that milestone.
Comment 3 Pierce Boggan [MSFT] 2017-10-06 01:21:05 UTC
Thanks for taking the time to report this issue. :)

Given this is a feature request or enhancement, I am closing this issue and adding a work item to our backlog.

Note You need to log in before you can comment on or make changes to this bug.