示例#1
0
        public LogEventArgs(bool isDebug, LogSeverityTypes severity, string sender, string message)
        {
            Severity = severity;
            Sender   = sender;
            Message  = message;

            IsDebug = isDebug;

            FormatMessage();
        }
示例#2
0
        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();
        }
示例#3
0
        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);
            }
        }
示例#4
0
 protected void LogMessage(string sendingMethod, LogSeverityTypes logSeverity, string messageFormat, params object[] messageParameters)
 {
     _logging.LogMessage(ModuleName, sendingMethod, logSeverity, messageFormat, messageParameters);
 }