microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.35k stars 304 forks source link

Consider making logging optional #244

Closed stefanloerwald closed 4 years ago

stefanloerwald commented 4 years ago

Hi,

I'm developing a library using MSAGL. I noticed quite a bit of log messages in the output that MSAGL generates, e.g. https://github.com/microsoft/automatic-graph-layout/blob/b9d18b0ce6d00525068590b8d92667efe1611af6/GraphLayout/MSAGL/Miscellaneous/Ranking/RankingLayout.cs#L67

This propagates all the way through to the client, which is not ideal (as they want to only use the feature, not know all the details of what the algorithm implementing it is doing). Could you please consider making the logging optional (e.g. by using a flag, or by using an ILogger<T>?

Thanks & best regards Stefan

levnach commented 4 years ago

Hi Stefan, Would you mind creating a pull request with the change, as the interested party:-)?

stefanloerwald commented 4 years ago

I don't mind, but there's a design decision to be made: ILogger, boolean flag, verbosity enum, removing all Console.Write* calls,... There are lots of ways to implement this. That decision should probably be with the maintainers/owners

stefanloerwald commented 4 years ago

Is there any interest by the maintainers in this? I had a look at the code base and to be honest, it feels rather unmaintained in the first place, as it's littered with commented out code and Console.WriteLine that seem to be purely for debugging purposes. Is there any work still being done on this?

levnach commented 4 years ago

It is up to you. There almost no development there now. But the library is used and maintained, and all "real" bugs are fixed. I also believe, that printouts are left in the code that is less used. But, for example, MdsGraphLayout is used a lot and it has some WriteLines.