Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there any cross-platform tool for AvaloniaUI to log events?

What logger should i use at AvaloniaUI? I know about Serilog, but is it cross-platform? Is there any built-in tool for this?

Moreover i need to log info to the .log file. This must be cross-platform (Windows, Linux and MacOS).

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Avalonia can log warnings and errors using System.Diagnostics.Trace.
To enable logging the LogToTrace method call should be present in
your Program.cs file:

public static AppBuilder BuildAvaloniaApp()
    => AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .LogToTrace();

And yes, you can log to file.

By default these trace messages would be logger to your IDE output
window. If you want to re-route these messages to different location,
use API provided by System.Diagnostics.Trace.

See more info about this at official site.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading