Ejemplo n.º 1
0
		/// <summary>
		/// For overriding how the "callstack entry" column is displayed.  The callstack entry is the primary row in the callstack, skipping past any wrapper functions.
		/// For ConsoleE PRO.
		/// </summary>
		/// <param name="p">p.area is the area in console where this item is being rendered</param>
		/// <param name="callstackEntry">text for the row in the callstack that ConsoleE has deemed primary</param>
		/// <param name="indexRow">index of the row in the callstack that ConsoleE has deemed primary, -1 if ConsoleE does not find a callstack row</param>
		/// <returns>filename string to display, do not return null</returns>
		static string FormatScriptCallstackEntry(OnFormatItemParams p, string callstackEntry, int indexRow)
		{
			if(indexRow == -1) // if no primary callstack row
				return string.Empty;
			if(indexRow >= 0 && indexRow < p.logEntry.rows.Length)
				return p.logEntry.rows[indexRow];
			return callstackEntry;
		}
Ejemplo n.º 2
0
		/// <summary>
		/// For overriding how the "script" column is displayed.  ConsoleE optionally can display the filename associated with the Debug.Log() call.  This hook allows you to format how the string is displayed in the console.
		/// For ConsoleE PRO.
		/// </summary>
		/// <param name="p">p.area is the area in console where this item is being rendered</param>
		/// <param name="filename">Full filename of the script file</param>
		/// <param name="hideExtension">user has clicked checkbox to hide extension</param>
		/// <returns>filename string to display, do not return null</returns>
		static string FormatScriptText(OnFormatItemParams p, string filename, bool hideExtension)
		{
			string s = hideExtension ? System.IO.Path.GetFileNameWithoutExtension(filename) : System.IO.Path.GetFileName(filename);
			if(p.area != ExtraItemArea.callstack)
				return s;
			return "Script: " + s;
		}
Ejemplo n.º 3
0
		/// <summary>
		/// For overriding how the frame count column is displayed.  ConsoleE optionally can display Time.frameCount for when Debug.Log() is called.  This hook allows you to format how frame count value is displayed.
		/// For ConsoleE FREE & PRO.
		/// </summary>
		/// <param name="p">p.area is the area in console where this item is being rendered</param>
		/// <param name="frameCount">value of Time.frameCount when Debug.Log() was called, -1 if app is not running</param>
		/// <param name="isFrameCountApproximate">true if the console was not able to determine exactly when the log message was created.  This can happen when a log entry is added before the ConsoleE window is enabled or if a Debug.Log() occurs during Application.logMessageReceived.</param>
		/// <returns>the frame count string, do not return null</returns>
		static string FormatFrameCount(OnFormatItemParams p, int frameCount, bool isFrameCountApproximate)
		{
			if(frameCount >= 0)
			{
				string s = !isFrameCountApproximate ? frameCount.ToString() : frameCount.ToString("~0");
				if(p.area != ExtraItemArea.callstack)
					return s;
				return "Frame: " + s;
			}
			return string.Empty; // log while app not running
		}
Ejemplo n.º 4
0
		/// <summary>
		/// For overriding how the "object" column is displayed.  ConsoleE optionally can display the name of the object passed to Debug.Log().  This hook allows you to format how the string is displayed in the console.
		/// For ConsoleE PRO.
		/// </summary>
		/// <param name="p">p.area is the area in console where this item is being rendered</param>
		/// <param name="objectName">Name of the object being displayed</param>
		/// <returns>object text display string, do not return null</returns>
		static string FormatObjectText(OnFormatItemParams p, string objectName)
		{
			if(p.area != ExtraItemArea.callstack)
				return objectName;
			return "Object: " + objectName;
		}
Ejemplo n.º 5
0
		/// <summary>
		/// For overriding how the time column is displayed.  ConsoleE optionally can display Time.time for when Debug.Log() is called.  This hook allows you to format how time is displayed.
		/// For ConsoleE FREE & PRO.
		/// </summary>
		/// <param name="p">p.area is the area in console where this item is being rendered</param>
		/// <param name="time">value of Time.time when Debug.Log() was called, -1 if app not running</param>
		/// <param name="isTimeApproximate">true if the console was not able to determine exactly when the log message was created.  This can happen when a log entry is added before the ConsoleE window is enabled or if a Debug.Log() occurs during Application.logMessageReceived.</param>
		/// <returns>the time string, do not return null</returns>
		static string FormatTime(OnFormatItemParams p, float time, bool isTimeApproximate)
		{
			if(time >= 0)
			{
				string s = !isTimeApproximate ? time.ToString("0.000") : time.ToString("~0.000");
				if(p.area != ExtraItemArea.callstack)
					return s;
				return "Time: " + s;
			}
			return string.Empty; // log while app not running
		}