private static void LogMessage(LogMessageArgs args)
        {
            var simpleEventBus = SimpleEventBus <AsyncMessageEvent> .Resolve();

            if (args?.Message != null)
            {
                simpleEventBus.Raise(new AsyncMessageEvent(args.Message.ToString()));
            }
        }
 public async Task LogMessageAsync(string context, string logMessage)
 {
     var args = new LogMessageArgs()
     {
         context = context,
         payload = new LogMessageArgs.Payload()
         {
             message = logMessage
         }
     };
     await _proxy.SendStreamDeckEvent(args);
 }
Esempio n. 3
0
        private static void LogExToFile(LogMessageArgs args)
        {
            var level   = args.Level;
            var message = args.Message;

            if (level >= SimpleLogLevel.Error && level < SimpleLogLevel.None)
            {
                var now      = DateHelper.Instance.GetDateNow();
                var fileName = string.Format("{0}_{1}.log", level.ToString(), now.ToString("yyyyMMdd-HH"));
                var filePath = Path.Combine(_folderPath, fileName);
                AsyncFile.Instance.AppendAllText(filePath, message.ToString(), true);
            }
        }
        private void OnLogMessage(string message, LogMessageArgs args)
        {
            _syncContext.Post(state =>
            {
                if (Entries.Count > MaxLogMessages)
                {
                    Entries.RemoveAt(0);
                }

                Entries.Add(new LogEntry
                {
                    Message  = message,
                    DateTime = args.Timestamp,
                    Color    = args.Color
                });
            }, null);
        }
Esempio n. 5
0
 private void OnLogMassage(object sender, LogMessageArgs e)
 {
     //Addlog(e.message);
     return;
 }
Esempio n. 6
0
 private void LogMessageHandler(object sender, LogMessageArgs args)
 {
 }
Esempio n. 7
0
 private void b_LogMessage(object sender, LogMessageArgs e)
 {
     logging(e.message);
 }
Esempio n. 8
0
 private void func_LogMessage(object sender, LogMessageArgs e)
 {
     ConsoleAssistance.WriteLine("[" + URLID + @"][log]" + e.message, ConsoleColor.Yellow);
 }