public static void AddMsg(string system, int priority, string msg) { if (!string.IsNullOrEmpty(system)) { AddMsgEventHandler l = handlers[system] as AddMsgEventHandler; LoggerEventArgs args = new LoggerEventArgs(priority, msg); if (l != null) { l(null, args); } l = handlers[""] as AddMsgEventHandler; if (l != null) { l(null, args); } } }
public void Logger_Log(object sender, LoggerEventArgs args) { Console.Error.Write("there is an error happens with priority {0} and message is {1}", args.Priority, args.Msg); }