Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmetic changes / fixes #76

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Cosmetic changes / fixes #76

wants to merge 6 commits into from

Conversation

Hecatron
Copy link
Contributor

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
Copy link
Owner

ddobrev commented Mar 23, 2018

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
Copy link
Collaborator

tritao commented Mar 23, 2018

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants