devlog about logging, crazy
added logging in-app and also to files
you can configure log levels, None disables file logging altogether
i was looking around to find a simple file logger for Microsoft.Extensions.Logging, but i didn’t like it so i made my own, even simpler version
took a bunch of attempts to make the architecture bearable, but it’s still kinda jank with the existence of LogPreferences.Instance (instead of using the service provider… but whatever, i make the rules :3)
turns out that MultiBinding doesn’t work for a bool that hides the bottom bar (idk why), so i did some wiring by subscribing to PropertyChanged in the preferences and the log list
only at the time of recording did i realize that the initial value isn’t set properly, so i gotta fix that
tried to set PublishAot to true for all projects (so i don’t have to specify it in dotnet publish), but that breaks the preview, so i had to revert the change
unhandled UI exceptions are now written to the file
the unobserved task exception event just… doesn’t seem to fire… i got rid of that
tried to use SemaphoreSlim to make the exiting thread block until an in-progress write operation completes, but that probably caused a deadlock because the app wouldn’t close
if a log entry happens to be in the middle of being written while you’re quitting, it gets cut in half, oh well
fun fact: the ItemsRepeater Avalonia control exists on GitHub, even the docs describe how to use it, but it just didn’t show up for me despite using the latest Avalonia version
this made me use a ListBox, which has selection (although you can’t see it because of the background of each log entry)
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.