MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Update

Method Update

Source/Editor/Windows/OutputLogWindow.cs:862–1029  ·  view source on GitHub ↗

(float deltaTime)

Source from the content-addressed store, hash-verified

860
861 /// <inheritdoc />
862 public override void Update(float deltaTime)
863 {
864 FlaxEngine.Profiler.BeginEvent("OutputLogWindow.Update");
865
866 // Read the incoming log messages
867 int logCount;
868 do
869 {
870 logCount = Editor.Internal_ReadOutputLogs(ref _outMessages, ref _outLogTypes, ref _outLogTimes, OutCapacity);
871
872 for (int i = 0; i < logCount; i++)
873 {
874 var entry = new Entry
875 {
876 Level = (LogType)_outLogTypes[i],
877 Time = new DateTime(_outLogTimes[i], DateTimeKind.Utc),
878 Message = _outMessages[i],
879 };
880 _entries.Add(entry);
881 _outMessages[i] = null;
882 _isDirty = true;
883 }
884 } while (logCount != 0);
885
886 if (_isDirty)
887 {
888 _isDirty = false;
889 var wasEmpty = _output.TextLength == 0;
890
891 // Cache fonts
892 _output.DefaultStyle.Font.GetFont();
893 _output.WarningStyle.Font.GetFont();
894 _output.ErrorStyle.Font.GetFont();
895
896 // Generate the output log
897 Span<Entry> entries = CollectionsMarshal.AsSpan(_entries);
898 var searchQuery = _searchBox.Text;
899 for (int i = _textBufferCount; i < _entries.Count; i++)
900 {
901 ref var entry = ref entries[i];
902 if (((int)entry.Level & _logTypeShowMask) == 0)
903 continue;
904 if (searchQuery.Length != 0 && entry.Message.IndexOf(searchQuery, StringComparison.OrdinalIgnoreCase) == -1)
905 continue;
906
907 var startIndex = _textBuffer.Length;
908 switch (_timestampsFormats)
909 {
910 case InterfaceOptions.TimestampsFormats.Utc:
911 _textBuffer.AppendFormat("[ {0} ]: ", entry.Time.ToUniversalTime());
912 break;
913 case InterfaceOptions.TimestampsFormats.LocalTime:
914 _textBuffer.AppendFormat("[ {0} ]: ", entry.Time);
915 break;
916 case InterfaceOptions.TimestampsFormats.TimeSinceStartup:
917 var diff = entry.Time - _startupTime;
918 _textBuffer.AppendFormat("[ {0:00}:{1:00}:{2:00}.{3:000} ]: ", diff.Hours, diff.Minutes, diff.Seconds, diff.Milliseconds);
919 break;

Callers

nothing calls this directly

Calls 12

ReplaceMethod · 0.80
ProcessTextMethod · 0.80
BeginEventMethod · 0.45
AddMethod · 0.45
GetFontMethod · 0.45
IndexOfMethod · 0.45
AppendMethod · 0.45
ToStringMethod · 0.45
MatchMethod · 0.45
ParseMethod · 0.45
EndEventMethod · 0.45

Tested by

no test coverage detected