From 82e923167623b779019397abf73b5b65badae516 Mon Sep 17 00:00:00 2001 From: Crzyrndm Date: Sat, 7 May 2016 23:49:37 +1200 Subject: [PATCH] update logging levels where appropriate --- FilterExtension/ConfigNodes/customCategory.cs | 10 +++++----- .../ConfigNodes/customSubCategory.cs | 4 ++-- FilterExtension/Core.cs | 4 ++-- FilterExtension/Editor.cs | 14 ++++++-------- .../000_FilterExtensions/FilterExtensions.dll | Bin 61952 -> 61952 bytes 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/FilterExtension/ConfigNodes/customCategory.cs b/FilterExtension/ConfigNodes/customCategory.cs index e0da4d6b..789bcca5 100644 --- a/FilterExtension/ConfigNodes/customCategory.cs +++ b/FilterExtension/ConfigNodes/customCategory.cs @@ -151,12 +151,12 @@ public void initialise() { if (string.IsNullOrEmpty(categoryName)) { - Core.Log("Category name is null or empty"); + Core.Log("Category name is null or empty", Core.LogLevel.Warn); return; } if (!hasSubCategories()) { - Core.Log(categoryName + " has no subcategories"); + Core.Log(categoryName + " has no subcategories", Core.LogLevel.Warn); return; } PartCategorizer.Category category; @@ -173,7 +173,7 @@ public void initialise() { if (!PartCategorizer.Instance.filters.TryGetValue(c => c.button.categoryName == categoryName, out category)) { - Core.Log("No category of this name was found to manipulate: " + categoryName); + Core.Log("No category of this name was found to manipulate: " + categoryName, Core.LogLevel.Warn); return; } else if (behaviour == categoryBehaviour.Replace) @@ -197,7 +197,7 @@ public void initSubcategory(int index, subCategoryItem toInit, PartCategorizer.C if (conflictsList.Contains(subCategories[j].subcategoryName)) { // if so, we skip this subcategory - Core.Log("Filters duplicated in category {0} between subCategories:\r\n{1} and {2}", Core.LogLevel.Log, categoryName, toInit.ToString(), subCategories[j].subcategoryName); + Core.Log("Filters duplicated in category {0} between subCategories:\r\n{1} and {2}", Core.LogLevel.Warn, categoryName, toInit.ToString(), subCategories[j].subcategoryName); return; } } @@ -205,7 +205,7 @@ public void initSubcategory(int index, subCategoryItem toInit, PartCategorizer.C customSubCategory subcategory = null; if (!Core.Instance.subCategoriesDict.TryGetValue(toInit.ToString(), out subcategory)) { - Core.Log("subcategory {0} not found in subcategories Dictionary", Core.LogLevel.Log, toInit.ToString()); + Core.Log("subcategory {0} not found in subcategories Dictionary", Core.LogLevel.Warn, toInit.ToString()); return; } diff --git a/FilterExtension/ConfigNodes/customSubCategory.cs b/FilterExtension/ConfigNodes/customSubCategory.cs index f0b18ea6..9af4801b 100644 --- a/FilterExtension/ConfigNodes/customSubCategory.cs +++ b/FilterExtension/ConfigNodes/customSubCategory.cs @@ -201,9 +201,9 @@ public bool checkSubCategoryHasParts(string category) if (Settings.debug) { if (!string.IsNullOrEmpty(category)) - Core.Log(subCategoryTitle + " in category " + category + " has no valid parts and was not initialised"); + Core.Log(subCategoryTitle + " in category " + category + " has no valid parts and was not initialised", Core.LogLevel.Warn); else - Core.Log(subCategoryTitle + " has no valid parts and was not initialised"); + Core.Log(subCategoryTitle + " has no valid parts and was not initialised", Core.LogLevel.Warn); } return false; } diff --git a/FilterExtension/Core.cs b/FilterExtension/Core.cs index e4efbcee..73c7a90e 100644 --- a/FilterExtension/Core.cs +++ b/FilterExtension/Core.cs @@ -58,7 +58,7 @@ void Awake() { instance = this; DontDestroyOnLoad(this); - Log(string.Empty); + Log(string.Empty, LogLevel.Warn); getConfigs(); getPartData(); @@ -141,7 +141,7 @@ private void getPartData() if (!partPathDict.ContainsKey(p.name)) partPathDict.Add(p.name, p.partUrl); else - Log(p.name + " duplicated part key in part path dictionary"); + Log(p.name + " duplicated part key in part path dictionary", LogLevel.Warn); if (PartType.isEngine(p)) processEnginePropellants(p); diff --git a/FilterExtension/Editor.cs b/FilterExtension/Editor.cs index 888f638e..3aa90a99 100644 --- a/FilterExtension/Editor.cs +++ b/FilterExtension/Editor.cs @@ -36,7 +36,7 @@ private IEnumerator editorInit() yield return null; if (Settings.debug) - Core.Log("Starting on Stock Filters"); + Core.Log("Starting on Stock Filters", Core.LogLevel.Log); // stock filters // If I edit them later everything breaks @@ -58,7 +58,7 @@ private IEnumerator editorInit() for (int i = 0; i < 4; i++) yield return null; if (Settings.debug) - Core.Log("Starting on general categories"); + Core.Log("Starting on general categories", Core.LogLevel.Log); // all FE categories foreach (customCategory c in Core.Instance.Categories) @@ -71,7 +71,7 @@ private IEnumerator editorInit() for (int i = 0; i < 4; i++) yield return null; if (Settings.debug) - Core.Log("Starting on late categories"); + Core.Log("Starting on late categories", Core.LogLevel.Log); // generate the set of parts to block if (blackListedParts == null) @@ -95,7 +95,7 @@ private IEnumerator editorInit() for (int i = 0; i < 4; i++) yield return null; if (Settings.debug) - Core.Log("Starting on removing categories"); + Core.Log("Starting on removing categories", Core.LogLevel.Log); List catsToDelete = PartCategorizer.Instance.filters.FindAll(c => c.subcategories.Count == 0); foreach (PartCategorizer.Category cat in catsToDelete) { @@ -110,7 +110,7 @@ private IEnumerator editorInit() for (int i = 0; i < 4; i++) yield return null; if (Settings.debug) - Core.Log("Refreshing parts list"); + Core.Log("Refreshing parts list", Core.LogLevel.Log); setSelectedCategory(); subcategoriesChecked = ready = true; @@ -169,9 +169,7 @@ public static void setSelectedCategory() } catch (Exception e) { - Core.Log("Category refresh failed"); - Core.Log(e.InnerException); - Core.Log(e.StackTrace); + Core.Log("Category refresh failed\r\n{0}\r\n{1}", Core.LogLevel.Error, e.InnerException, e.StackTrace); } } diff --git a/GameData/000_FilterExtensions/FilterExtensions.dll b/GameData/000_FilterExtensions/FilterExtensions.dll index 51022291c5bbfadc9f17235cb30b86946980cd02..c1c0885c30f5151a97c9bec786ec60c18e5be240 100644 GIT binary patch delta 540 zcmZp8!rbtLc|r%1%(aPKa*XdLt_)|KGntXGp7G1%M#g%{3ml9LAm9PSObo0H2Bi!P zIg=R}7$<*xWxhFpNt~5Yd~yc63Xtq&UkW6RIY8u1jzmWB&DNYsyg({W>d@TsD*IVC_oLnDKZz%+()3{RjuTY+$vb3jwPb9eGH znrvpRoy+KXN=T1EnIRNNRx=y~lEz@RHA6IzUCgirNJ=x<14(VLxHCf$klhV*l^%mP zSR@)uCNp$xeqATc!l<&Dz4<;9qt52%t^X8MERCJb-7HKkbuA2yTy;$hOigqx9bJue zEuD=FObwjOjExPAHghhIHehs~oO)ePm6w4F=nMmfS_TNq5XfSP{BeA;USo*EtjBW{ z0=5|oZC-L+N{EY-omog%sNtoo%;aM)kBKla9D&9s$m91wY=w!6VvH9yZ++#-xS8+G SFJ`6>7Mle>yl0$fzzzUe1%yNZ delta 528 zcmZp8!rbtLc|r%%(&ZDoac}s3L zkrxx|1scex5y`;7rY*yyu?k2RZBt|@(6D1*;1b)c=%>%l$UQkQ^q!*;cae%RLjkf5 z_WW2zpel_Bpf2`&e~=C&^X@TdF)#{%oy&0J27}S&j4&QX*$`z02IbIThL{Eh29Tt( zd#I-ikj??}Uu>QjK2=n#>jxHvS z=B{RzuA3Q`M;kEePmaB=C&=);px9I6&{41cbJbi|mOq=fdBb%nAr5wSCLvv+hL@AC xygVkf1sZ=K51s?D6(%Z*F&@}_^pz*$WCuop&3tcuF*7}|*ev+rJ>x_Jb^v5Cg#7>j