ddobrev / QtSharp

Mono/.NET bindings for Qt
Other
571 stars 52 forks source link

Cosmetic changes / fixes #76

Open Hecatron opened 6 years ago

Hecatron commented 6 years ago

Hi, I've recently added in some changes These are mostly cosmetic, and based around personal preference so I'll understand if they don't make it in Let me know what you think.

I've tested on Windows using Visual Studio 2015 / QT 5.9.1 I've not managed to test against mono / linux just yet, currently looking at that at the moment.

  1. Moved a couple of functions into QtInfo since it seems to be a better place for them also it makes the cli Program look a little less cluttered.

  2. Updated some of the NuGet package references to later versions (not CppSharp since there's some small API changes there that need to be looked at)

  3. Added in LibLog / SeriLog logging LibLog is an abstraction layer which is normally used in libraries to Log The general idea is liblog figures out which logging system is in use and directs the messages to that.

Serilog is a specific implementation of a Logger that's used within the CLI Application I've added in coloured console / file logging so far, although there's also a full list of sinks here https://github.com/serilog/serilog/wiki/Provided-Sinks There's also a wrapper in there to pickup on the Console.WriteLine's from CppSharp and pipe them via Serilog / LibLog

  1. fixed reference for System.XML to System.Xml for mono / linux

I've got some other ideas as well like docs I'll take another look at, but I figured I'd see if these make it in first.

ddobrev commented 6 years ago

Thank you very much for your work. I'm afraid I am too busy now but I'll look into it over the week-end.

tritao commented 6 years ago

By the way, you can replace CppSharp's logging/diagnostic implementation, see https://github.com/mono/CppSharp/blob/8479ed3735b0e88b9dd816993bf8a0f0028e711f/src/Core/Diagnostics.cs#L41

Hecatron commented 6 years ago

Thanks for the info, I've now set it up to redirect CppSharp's Diagnostics across to LibLog / Serilog so now it picks up on the different levels of log message for filtering.

What I could do is take out the LibLog file I've added to QtSharp then replace that with the same Diagnostics.cs from CppSharp. Then route everything to Serilog within QtSharp.CLI. Or just leave it as is let me know if you want me to change that