PaciStardust / HOSCY

Companion for OSC and Communication
GNU General Public License v2.0
36 stars 8 forks source link

Improved logging #6

Closed hyblocker closed 2 years ago

hyblocker commented 2 years ago

C# allows you to make significantly more verbose logging, which would likely be ideal to be able to troubleshoot issues much faster.

For example you might want to append this to the function signature:

public static void Info(string msg, [CallerLineNumber] int lineNumber = 0, [CallerFilePath] string filePath = "", [CallerMemberName] string memberName = "") {
    Console.WriteLine(FormatLogMessage(msg, lineNumber, filePath, memberName);
}

Which would then allow you to get log messages such as:

INFO    MyClass.cs::MyMethod:12] Hello World!

Additionally you might want to refactor the logger outside of the OscMultitool.Services namespace.

PaciStardust commented 2 years ago

Fixed in commit