private void WriteToUWPConsole(LogEntry logEntry)
        {
            var message =
                $"{logEntry.Timestamp.ToLocalTime():yyyy-MM-dd HH:mm:ss.fff} #{logEntry.ThreadId:00} [{logEntry.Level,-5}] {logEntry.Name} : {logEntry.Message}";

            Debug.WriteLine(message);
        }
        private void WriteToAndroidConsole(LogEntry logEntry)
        {
            var message =
                $"{logEntry.Timestamp.ToLocalTime():yyyy-MM-dd HH:mm:ss.fff} #{logEntry.ThreadId:00} [{logEntry.Level,-5}] {logEntry.Name} : {logEntry.Message}";

            switch (logEntry.Level)
            {
                case LogLevel.Perf:
                case LogLevel.Debug:
                    Log.Debug(logEntry.Name, message);
                    break;
                case LogLevel.Info:
                    Log.Info(logEntry.Name, message);
                    break;
                case LogLevel.Warn:
                    Log.Warn(logEntry.Name, message);
                    break;
                case LogLevel.Error:
                    Log.Error(logEntry.Name, message);
                    break;
                default:
                    Log.Debug(logEntry.Name, message);
                    break;
            }
        }
Esempio n. 3
0
        private void WriteToLogFile(LogEntry logEntry)
        {
            lock (_sync)
            {
                var message =
                    $"{logEntry.Timestamp.ToLocalTime():yyyy-MM-dd HH:mm:ss.fff} #{logEntry.ThreadId:00} [{logEntry.Level,-5}] {logEntry.Name} : {logEntry.Message}";

                _writer.WriteLine(message);
                _writer.Flush();
            }
        }
Esempio n. 4
0
 public void Log(LogLevel level, string message)
 {
     var entry = new LogEntry(DateTime.UtcNow, Name, level, Environment.CurrentManagedThreadId, message);
     owner._entries.OnNext(entry);
 }