Ejemplo n.º 1
0
        /// <summary>
        /// Store Log Entry from External system.
        /// </summary>
        /// <param name="entry">New log entry</param>
        /// <returns></returns>
        public async Task <IHttpActionResult> Post(NewLogEntry entry)
        {
            IStorage s = _storageFactory.ResolveStorage();
            await s.StoreAsync(Mapper.Map <LogEntry>(entry));

            return(Ok());
        }
Ejemplo n.º 2
0
        private void Log(LogLevel level, string message, Exception ex)
        {
            Contract.Requires(message != null);

            lock (sync)
            {
                NewLogEntry?.Invoke(level, message, ex);
            }
        }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 4
0
        /// <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));
        }
Ejemplo n.º 5
0
 protected virtual void OnNewLogEntry(NewLogEntryEventArgs e)
 {
     NewLogEntry?.Invoke(this, e);
 }
Ejemplo n.º 6
0
 private void OnNewEntry(object sender, BotLoggerEntry entry) => NewLogEntry?.Invoke(this, entry);
Ejemplo n.º 7
0
 protected virtual void OnNewLogEntry(ILogEntry logEntry)
 {
     NewLogEntry?.Invoke(logEntry);
 }
Ejemplo n.º 8
0
 public void WriteLog(string log) => NewLogEntry?.Invoke(log, EventArgs.Empty);
Ejemplo n.º 9
0
 private void OnLog(string v)
 {
     NewLogEntry?.Invoke(v);
 }