/// <summary> /// Show LogMessages in Editor Console Window. /// The Level NotificationType of the Message Objekt effects on the type of output. /// (notification, warning, error) /// </summary> /// <param name="output">PostboxLogMessage Object</param> private void PrintInDebuglog(PostboxLogMessage output) { switch (output.NotificationLevel) { case PostboxLogbook.NotificationType.Notification: if (ShowNotificationInDebug) { Debug.Log(output.Print()); } break; case PostboxLogbook.NotificationType.Warning: if (ShowWarningInDebug) { Debug.LogWarning(output.Print()); } break; case PostboxLogbook.NotificationType.Error: if (ShowErrorInDebug) { Debug.LogError(output.Print()); } break; case PostboxLogbook.NotificationType.APICalls: if (ShowAPICallsInDebug) { Debug.Log(output.Print()); } break; default: break; } }
/// <summary> /// Add current Message to Textbox-Output. /// </summary> /// <param name="output">LogMessage from Logbook</param> /// <param name="clamp">Character count for max dawed text.</param> private void PrintInTextbox(PostboxLogMessage output, int clamp) { if (Textbox) { // Prepair Textbox string TextOutputString = output != null ? Textbox.text + output.Print() + "\r\n" : Textbox.text; TextOutputString = TextOutputString.Substring((TextOutputString.Length - clamp < 0 ? 0 : TextOutputString.Length - clamp)); // Show Text in Box switch (output.NotificationLevel) { case PostboxLogbook.NotificationType.Notification: if (ShowNotificationInTextbox && outputInTextfield) { Textbox.text = TextOutputString; } break; case PostboxLogbook.NotificationType.Warning: if (ShowWarningInTextbox && outputInTextfield) { Textbox.text = TextOutputString; } break; case PostboxLogbook.NotificationType.Error: if (ShowErrorInTextbox && outputInTextfield) { Textbox.text = TextOutputString; } break; case PostboxLogbook.NotificationType.APICalls: if (ShowAPICallsInTextbox && outputInTextfield) { Textbox.text = TextOutputString; } break; default: break; } } else { Debug.LogWarning("You have to assign a Textbox to use Output in Textfield."); } }