Example #1
0
        private void Log(LogLevel level, string message, Exception ex)
        {
            Contract.Requires(message != null);

            lock (sync)
            {
                NewLogEntry?.Invoke(level, message, ex);
            }
        }
Example #2
0
        /// <summary>
        /// Logs the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="type">The type.</param>
        public void Log(string message, MessageTypeEnum type)
        {
            MessageReceivedEventArgs msg = new MessageReceivedEventArgs(message, type);

            MessageReceived.Invoke(this, msg);
            this.logs.Add(msg);
            string[] args = { message, type.ToString() };
            NewLogEntry?.Invoke(this, new CommandReceivedEventArgs((int)CommandEnum.LogCommand, args, null));
        }
        /// <summary>
        /// Logs the specified message.
        /// </summary>
        /// <param name="msg">The message.</param>
        /// <param name="msg_type">The type.</param>
        public void Log(string msg, MessageTypeEnum msg_type)
        {
            //creating the new message
            MessageReceivedEventArgs new_msg = new MessageReceivedEventArgs(msg, msg_type);

            MessageReceived.Invoke(this, new_msg);
            //adding a new message
            this.logs.Add(new_msg);
            string[] args = { msg, msg_type.ToString() };
            //invoking log
            NewLogEntry?.Invoke(this, new CommandReceivedEventArgs((int)CommandEnum.LogCommand, args, null));
        }
Example #4
0
 protected virtual void OnNewLogEntry(NewLogEntryEventArgs e)
 {
     NewLogEntry?.Invoke(this, e);
 }
Example #5
0
 private void OnNewEntry(object sender, BotLoggerEntry entry) => NewLogEntry?.Invoke(this, entry);
Example #6
0
 protected virtual void OnNewLogEntry(ILogEntry logEntry)
 {
     NewLogEntry?.Invoke(logEntry);
 }
 public void WriteLog(string log) => NewLogEntry?.Invoke(log, EventArgs.Empty);
Example #8
0
 private void OnLog(string v)
 {
     NewLogEntry?.Invoke(v);
 }