Hi everyone,
 
    Here is a possible patch for selective logging to console. Now, messages like "cant resolve internal call to" can be removed. They not only appear when corlib and mono runtime are out of sync, they also appear when embedding mono, and this is annoying.
 
    So here are 3 files:
        - A diff for some mono files to call the new logging api,
        - Two files for the new logging functions. (to place in ./mono/mono/utils)
 
Two options are also added to command line :
  • --log-level=VALUE, for which the possible values are from 2 to 7 (mapped from the G_LOG_LEVEL_XXX enum). 2 stands for error messages only, 7 for error+critical+warning+message+info+debug.
  • --log-mask=MASK, this option is not listed in the usage infos, it is the decimal value of the mask. See mono-logger.h for more infos on possible values.
For code usage sample, see loader.c line 72.
 
To remove messages when using mcs, add --log-level=3 in the mcs script file.
 
This is only a patch proposition, is that okay lupus / gonzalo ?
 
The patch also includes header updates for object.h and threads.h that were using the "this" keyword as a function parameter, which is incompatible for inclusion in a C++ source file.
 
Jerome.

Attachment: logcpp.diff
Description: Binary data

Attachment: mono-logger.c
Description: Binary data

Attachment: mono-logger.h
Description: Binary data

Reply via email to