/// <summary> /// Quick log designed to write to console without having to input the category if /// you've pre-registered the class with that category (see GetCatForClass above) /// </summary> /// <param name="text"></param> /// <param name="fileName"></param> /// <param name="lineNumber"></param> public static void QLog(string text, [CallerFilePath] string fileName = "", [CallerLineNumber] int lineNumber = 0) { string[] parsedFileName = fileName.Split('/'); string className = parsedFileName[parsedFileName.Length - 1]; if (className.Contains(".cs")) { className.Remove(className.Length - 3); } AtomicLogCategory cat = GetCategoryForClass(className); if (cat == AtomicLogCategory.none) { return; } else { Log(className.ToUpper() + " " + lineNumber + ": " + text, cat); } }
public static void Log(string text, AtomicLogCategory category) { switch (category) { case AtomicLogCategory.input: Debug.Log("Input: " + text); break; case AtomicLogCategory.molecules: Debug.Log("Molecules: " + text); break; case AtomicLogCategory.selection: Debug.Log("Selection: " + text); break; case AtomicLogCategory.transformation: Debug.Log("Transformation: " + text); break; } }