Пример #1
0
        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);
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
 /// <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));
 }
Пример #4
0
 /// <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");
 }
Пример #5
0
 /// <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);
 }
Пример #6
0
 internal void OnLogReceivedInternal(CustomLogLevel level, string category, string message)
 {
     OnLogReceived?.Invoke(level, category, message);
 }
Пример #7
0
 private void FireEvent(string str)
 {
     OnLogReceived?.Invoke(str);
 }
Пример #8
0
 private async Task Log(LogMessage e)
 {
     Debug.WriteLine(e.Message);
     OnLogReceived?.Invoke(this, e);
 }
Пример #9
0
 extern public static int BS2_StartMonitoringLog(IntPtr context, UInt32 deviceId, OnLogReceived cbOnLogReceived);