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); }
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); }
private void OnLogMassage(object sender, LogMessageArgs e) { //Addlog(e.message); return; }
private void LogMessageHandler(object sender, LogMessageArgs args) { }
private void b_LogMessage(object sender, LogMessageArgs e) { logging(e.message); }
private void func_LogMessage(object sender, LogMessageArgs e) { ConsoleAssistance.WriteLine("[" + URLID + @"][log]" + e.message, ConsoleColor.Yellow); }