LogEventHandler Delegate |
Namespace: Telogis.GeoBase.Diagnostics
class MyLogClass { static void Main() { // Use LogEventHandler to handle log events. Log.LogEvent += new LogEventHandler(Log_LogEvent); // Create the log type and content. Log.Info("Message is {0}", "Hello World"); Console.ReadKey(); } public static void Log_LogEvent(LogEntry ev) { // Write out the log entry to the console. // use StreamWriter to save to file System.Console.Out.WriteLine("Log message: " + ev.Message); } }