You can use the global logging object:
enum LogLevel
{
Info,
Warning,
Error
}
delegate void OnLog (string msg, LogLevel level);
interface ILogger
{
void Log(string msg, LogLevel level);
event OnLog;
}
Then extend ILogger to the class that you acquire using the public static method in the program class.
And in your main form, join the OnLog event and use it to print messages for yourself. Then all you have to do is call the log method in your static method using an SQL query.
:)
source
share