/// <summary> /// Print the value of the variable in a simple and clean way /// </summary> /// <typeparam name="T"></typeparam> /// <param name="var"></param> public static void LogVar <T>(string label, T var) { string var_name = label; string var_value = Convert.ToString(var); DevLoggingOutput.Log(Dev.FunctionHeader() + Dev.Colorize(var_name, _param_color) + " = " + Dev.Colorize(var_value, _log_color)); }
public static void Log(string text, Color color) { #if LOGLIB DevLoggingOutput.Log(Dev.FunctionHeader() + Dev.Colorize(text, Logger.LogHelpers.ColorToHex(color))); #else DevLoggingOutput.Log(Dev.FunctionHeader() + Dev.Colorize(text, color.ColorToHex())); #endif }
/// <summary> /// Print the content of the array passed in /// </summary> /// <typeparam name="T"></typeparam> /// <param name="array"></param> public static void LogVarArray <T>(string label, IList <T> array) { int size = array.Count; for (int i = 0; i < size; ++i) { string vname = label + "[" + Dev.Colorize(Convert.ToString(i), _log_color) + "]"; DevLoggingOutput.Log(Dev.FunctionHeader() + Dev.Colorize(vname, _param_color) + " = " + Dev.Colorize(Convert.ToString(array[i]), _log_color)); } }
/// <summary> /// Print the value of the variable in a simple and clean way... /// ONLY USE FOR QUICK AND TEMPORARY DEBUGGING (will not work as expected outside the editor) /// </summary> /// <typeparam name="T"></typeparam> /// <param name="var"></param> public static void LogVar <T>(T var) { #if UNITY_EDITOR string var_name = GetVarName(var);// var.GetType(). #else string var_name = var == null ? "Null" : var.GetType().Name; #endif string var_value = Convert.ToString(var); DevLoggingOutput.Log(Dev.FunctionHeader() + Dev.Colorize(var_name, _param_color) + " = " + Dev.Colorize(var_value, _log_color)); }
public static void LogVarOnlyThis <T>(string label, T var, string input_name, string this_name) { if (this_name != input_name) { return; } string var_name = label; string var_value = Convert.ToString(var); DevLoggingOutput.Log(Dev.FunctionHeader() + Dev.Colorize(var_name, _param_color) + " = " + Dev.Colorize(var_value, _log_color)); }
public static void PrintHideFlagsInChildren(GameObject parent, bool print_nones = false) { bool showed_where = false; if (print_nones) { Dev.Where(); showed_where = true; } foreach (Transform child in parent.GetComponentsInChildren <Transform>()) { if (print_nones && child.gameObject.hideFlags == HideFlags.None) #if LOGLIB { DevLoggingOutput.Log(Dev.Colorize(child.gameObject.name, Logger.LogHelpers.ColorToHex(Color.white)) + ".hideflags = " + Dev.Colorize(Convert.ToString(child.gameObject.hideFlags), _param_color)); } #else { DevLoggingOutput.Log(Dev.Colorize(child.gameObject.name, Color.white.ColorToHex()) + ".hideflags = " + Dev.Colorize(Convert.ToString(child.gameObject.hideFlags), _param_color)); }
public static void Log(string text, float r, float g, float b) { DevLoggingOutput.Log(Dev.FunctionHeader() + Dev.Colorize(text, Dev.ColorStr(r, g, b))); }
public static void Log(string text) { DevLoggingOutput.Log(Dev.FunctionHeader() + Dev.Colorize(text, _log_color)); }
public static void Where(int stackFrameOffset = 0) { DevLoggingOutput.Log(" :::: " + Dev.FunctionHeader(stackFrameOffset)); }