public void Logi(LogType logType, string obj, string description) { var log = new Log(logType, obj, description, null); var str = "[" + logType + "] " + log.Header; Console.WriteLine(str); OnLogReceived?.Invoke(log); }
private void InternalLog(LogType logType, string obj, string description, int skipFrames) { lock (m_LogLock) { var log = new Log(logType, obj, description, new StackTrace(skipFrames)); var str = "[" + logType + "] " + log.Header; Console.WriteLine(str); Debug.WriteLine(str); m_LogList.Add(log); var strToFile = log.HasDescription() ? str + Environment.NewLine + description : str; var multilineStr = new string[] { strToFile, log.Stacktrace.ToString() + Environment.NewLine }; try { File.AppendAllLines(LogPath, multilineStr); } catch (IOException) { } OnLogReceived?.Invoke(log); } }
/// <summary> /// Prints a line to the event objects /// </summary> /// <param name="fmt">formatted text: use {0}, {1} to assign objects</param> /// <param name="objects">any object that has a ToString function</param> public static void PrintLine(string fmt, params object[] objects) { OnLogReceived.Invoke(string.Format(fmt + "\n", objects)); }
/// <summary> /// Prints a line to the event objects /// </summary> /// <param name="fmt">text you want to print</param> public static void PrintLine(string msg) { OnLogReceived.Invoke(msg + "\n"); }
/// <summary> /// Prints text to the event objects /// </summary> /// <param name="fmt">text you want to print</param> public static void Print(string msg) { OnLogReceived.Invoke(msg); }
internal void OnLogReceivedInternal(CustomLogLevel level, string category, string message) { OnLogReceived?.Invoke(level, category, message); }
private void FireEvent(string str) { OnLogReceived?.Invoke(str); }
private async Task Log(LogMessage e) { Debug.WriteLine(e.Message); OnLogReceived?.Invoke(this, e); }
extern public static int BS2_StartMonitoringLog(IntPtr context, UInt32 deviceId, OnLogReceived cbOnLogReceived);