Custom Logger for .NET
- Add DLog.NET from nuget: https://www.nuget.org/packages/DLog.NET/ or by Manage Nuget Packages option in Visual Studio
- Instantiate DLogger class:
DLogger myLogger = new DLogger();
- Add path to log file that you want to use by:
myLogger.AddTargetFile(@"C:\Logs\MyLog.txt");
- (optional) Add Winforms controls for log output
myLogger.AddTargetTextBox(tbLog);
. Currently supported controls are:TextBox
,NotifyIcon
,ProgressBar
,ToolStripProgressBar
- Use
Write(string message, (optional) int progress);
to output message to all log targets. Optionalprogress
parameter is used for setting progress value on ProgressBar controls.
- Change parameters for
AddTarget
methods to accept Interfaces instead of Explicit classes - Support for WPF and ASP.NET
Issues, pull requests, forks, etc... will be handled here in Github, so feel free to use all github functionalities provided.
You can contact me directly by writing email to piczok(at)gmail.com