[Mono-list] Diagnostic Messages
Jonathan Pryor
jonpryor@vt.edu
27 May 2002 15:53:38 -0400
Comments inline.
On Mon, 2002-05-27 at 14:47, Lawrence Pit wrote:
Hi Jonathan,
> Should the `DefaultTraceListener' do nothing, even though diagnostic
> messages have been requested? I should think not; it should do
> something, otherwise it will look like it isn't working, leading to
> annoyed developers.
In my opinion mono on win32 systems would use OutputDebugString and on *nix
systems this function would simply send its messages to /dev/null. It should
not send it to console, as ms.net doesn't do that as well; you have to
explicitely set that up in that case.
As there's no debugging device on *nix systems, developers couldn't get
annoyed as they couldn't have any expectations in this case. ;-)
I'd make a witty remark to that, but I'm at a loss. :-)
Suffice it to say that being used to an environment isn't a valid reason
to not improve it. But then we have to determine if it's really an
improvement, an argument which would be entirely subjective.
I do agree that on Win32 OutputDebugString should be used. However,
before I implement that I need to figure out how to properly make the C#
code conditional, for either Win32 or Unix systems. This would likely
require changing the `System.build' file, and probably introduces
logistical issues. For example, if we did this, we would have a
`System.dll' that was specific to Windows or specific to Linux.
`corlib.dll' need to do the same thing, so this shouldn't be a major
issue.
> However...what if the program has no application configuration file?
> What is a reasonable default? Not everyone will know about application
> configuration files, though perhaps they should. This is where I
> believe a ``--diagnostics'' parameter to mono/mint would be useful: you
> could enable/disable the output of diagnostic messages without needing
> to create a configuration file.
I can understand that, though instead of --diagnostics=trace I would
say --trace=/dev/console or --trace=/dev/stdout
or --trace=/home/me/myfile.log, etc. Same for debugging messages, allow a
user the choice of the file or device to send the output to, instead of only
having the option to have it send to stdout.
This is, in effect, Proposal 3 of "Diagnostic Messages: Proposals."
Except that instead of it being a parameter to mono/mint, it's an
environment variable (MONO_TRACE), and we use the .NET names for
standard output and standard error (i.e. `Console.Out', not
/dev/console, though `/dev/console' would be valid under my proposal as
a normal file name).
Greets,
Lawrence
Thank you for your suggestions. Your rebuttals have been good
food-for-thought, allowing me to come up with better proposals because
of them.
- Jon