public LogEventArgs(bool isDebug, LogSeverityTypes severity, string sender, string message) { Severity = severity; Sender = sender; Message = message; IsDebug = isDebug; FormatMessage(); }
public LogEventArgs(bool isDebug, string sender, LogSeverityTypes logSeverity, string messageFormat, params object[] messageParameters) { Sender = sender; Message = messageParameters != null?string.Format(messageFormat, messageParameters) : messageFormat; Severity = logSeverity; IsDebug = isDebug; FormatMessage(); }
public void LogMessage(object sender, string sendingMethod, LogSeverityTypes logSeverity, string messageFormat, params object[] messageParameters) { var senderText = sender is ModuleBase ? ((ModuleBase)sender).ModuleName : sender.ToString().Split('.').Last(); var source = string.Format("{0}.{1}", senderText, sendingMethod); var eventArgs = new LogEventArgs(StealthBot.IsDebug, source, logSeverity, messageFormat, messageParameters); if (MessageLogged != null) { MessageLogged(senderText, eventArgs); } }
protected void LogMessage(string sendingMethod, LogSeverityTypes logSeverity, string messageFormat, params object[] messageParameters) { _logging.LogMessage(ModuleName, sendingMethod, logSeverity, messageFormat, messageParameters); }