Introduction
This is a simple Log component that will help you to create Logs for your application.
It is very simple and easy to use.
Code
The public static string GetNewLogFilename()
creates a log filrname if
DD-MM-YYYY.LOG format. You also have a LogType
enum to specify the
log entry types
public enum LogType
{
Info = 1,
Warning = 2,
Error = 3
}
How use use
....
string strMyLogFile = Logger.GetNewLogFilename()
Logger objLog = new Logger( strMyLogFile );
....
objLog.WriteLine(LogType.Info,"Application started.");
....
objLog.WriteLine(LogType.Warning,
"Application is going to fail here... be alert...");
....
objLog.WriteLine(LogType.Error,"The Application has died just now :(");
....
objLog.WriteLine(LogType.Info,"Terminating Application");
Have fun C#ing.
Gevik Babakhani is a software architect currently residing in The Netherlands. He started programming as hobby from the age of 12. His professional career began in 1997. Since then he works fulltime as a software architect. Currently he dedicates time and effort in Microsoft.NET.