ChayoteJarocho / MastodonGitHubBot

A bot that retrieves info from GitHub and publishes it in Mastodon.
MIT License
0 stars 0 forks source link

Use EventLog on Windows #7

Closed ChayoteJarocho closed 1 year ago

ChayoteJarocho commented 1 year ago

This tool is normally run on Windows as a Scheduled Task, meaning the console window is not normally visible. This means that Event Viewer is the most appropriate way to debug the tool's behavior.

.NET allows the creation of Windows Events via System.Diagnostics.EventLog APIs. Naturally, this aassembly is only available on Windows. Unfortunately, it can only be executed as an administrator since Windows Vista, due to the internal requirement of verifying if the event should exist under the "Security" log category, which is only readable as an administrator.

This PR adds the following changes: