Skip to content

Commit

Permalink
Draw "Always Append" toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomiejwolk committed May 2, 2015
1 parent 5be3e62 commit 05915e1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Editor/LoggerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class LoggerEditor : Editor {
private SerializedProperty logInRealTime;
private SerializedProperty methodFilter;
private SerializedProperty qualifiedClassName;
private SerializedProperty append;

#endregion SERIALIZED PROPERTIES

Expand All @@ -44,6 +45,7 @@ public override void OnInspectorGUI() {

DrawEnableOnPlayToggle();
DrawLogInRealTimeToggle();
DrawAppendToggle();
DrawEchoToConsoleToggle();

EditorGUILayout.Space();
Expand Down Expand Up @@ -92,6 +94,7 @@ private void OnEnable() {
indentLine = serializedObject.FindProperty("indentLine");
classFilter = serializedObject.FindProperty("classFilter");
methodFilter = serializedObject.FindProperty("methodFilter");
append = serializedObject.FindProperty("append");
}

#endregion UNITY MESSAGES
Expand All @@ -108,6 +111,20 @@ private void DrawAppendDropdown() {
Script.DisplayOptions);
}

private void DrawAppendToggle() {
var disabled = logInRealTime.boolValue ? true : false;

EditorGUI.BeginDisabledGroup(disabled);

append.boolValue = EditorGUILayout.Toggle(
new GUIContent(
"Always Append",
"Always append messages to the log file."),
append.boolValue);

EditorGUI.EndDisabledGroup();
}

private void DrawClearLogFileButton() {
// Don't allow reseting log file while logging.
if (Script.LoggingEnabled) return;
Expand Down

0 comments on commit 05915e1

Please sign in to comment.