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

Method Add

Source/Editor/Windows/DebugLogWindow.cs:463–501  ·  view source on GitHub ↗

Adds the specified log entry. The log entry description.

(ref LogEntryDescription desc)

Source from the content-addressed store, hash-verified

461 /// </summary>
462 /// <param name="desc">The log entry description.</param>
463 public void Add(ref LogEntryDescription desc)
464 {
465 if (_entriesPanel == null)
466 return;
467
468 // Create new entry
469 switch (_timestampsFormats)
470 {
471 case InterfaceOptions.TimestampsFormats.Utc: desc.Title = $"[{DateTime.UtcNow}] {desc.Title}"; break;
472 case InterfaceOptions.TimestampsFormats.LocalTime: desc.Title = $"[{DateTime.Now}] {desc.Title}"; break;
473 case InterfaceOptions.TimestampsFormats.TimeSinceStartup: desc.Title = string.Format("[{0:g}] ", TimeSpan.FromSeconds(Time.TimeSinceStartup)) + desc.Title; break;
474 }
475 var newEntry = new LogEntry(this, ref desc);
476
477 // Enqueue
478 lock (_locker)
479 {
480 _pendingEntries.Add(newEntry);
481 }
482
483 if (newEntry.Group == LogGroup.Warning && _iconType < LogType.Warning)
484 {
485 _iconType = LogType.Warning;
486 UpdateIcon();
487 }
488
489 if (newEntry.Group == LogGroup.Error && _iconType < LogType.Error)
490 {
491 _iconType = LogType.Error;
492 UpdateIcon();
493 }
494
495 // Pause on Error (we should do it as fast as possible)
496 if (newEntry.Group == LogGroup.Error && _pauseOnErrorButton.Checked && Editor.StateMachine.CurrentState == Editor.StateMachine.PlayingState)
497 {
498 Editor.Log("Pause Play mode on error (toggle this behaviour in the Debug Log panel)");
499 Editor.Simulation.RequestPausePlay();
500 }
501 }
502
503 /// <summary>
504 /// Gets or sets the selected entry.

Callers 15

LoadMethod · 0.45
GetAllProjectsFunction · 0.45
ReadJsonMethod · 0.45
GetAllProjectsMethod · 0.45
LoadMethod · 0.45
EditorMethod · 0.45
RegisterModuleMethod · 0.45
BuildAllMeshesSDFMethod · 0.45
LoadProductMethod · 0.45
AddPlatformToolsMethod · 0.45
SetupMethod · 0.45
GetFilesToDeployMethod · 0.45

Calls 4

FormatMethod · 0.80
FromSecondsMethod · 0.80
RequestPausePlayMethod · 0.80
LogMethod · 0.45

Tested by

no test coverage detected