@@ -201,7 +201,7 @@ public class DebugLogManager : MonoBehaviour
201201
202202 [ SerializeField ]
203203 [ Tooltip ( "If a log is longer than this limit, it will be truncated. This helps avoid reaching Unity's 65000 vertex limit for UI canvases" ) ]
204- private int maxLogLength = 10000 ;
204+ internal int maxLogLength = 10000 ;
205205
206206#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL
207207 [ SerializeField ]
@@ -1056,44 +1056,6 @@ public void ReceivedLog( string logString, string stackTrace, LogType logType )
10561056 case LogType. Exception: if ( ! receiveExceptionLogs ) return ; break ;
10571057 }
10581058
1059- // Truncate the log if it is longer than maxLogLength
1060- int logLength = logString. Length;
1061- if ( stackTrace == null )
1062- {
1063- if ( logLength > maxLogLength )
1064- logString = logString. Substring( 0 , maxLogLength - 11 ) + "< truncated> ";
1065- }
1066- else
1067- {
1068- logLength += stackTrace. Length;
1069- if ( logLength > maxLogLength )
1070- {
1071- // Decide which log component(s) to truncate
1072- int halfMaxLogLength = maxLogLength / 2 ;
1073- if ( logString . Length >= halfMaxLogLength )
1074- {
1075- if ( stackTrace . Length >= halfMaxLogLength )
1076- {
1077- // Truncate both logString and stackTrace
1078- logString = logString . Substring ( 0 , halfMaxLogLength - 11 ) + "<truncated>" ;
1079-
1080- // If stackTrace doesn't end with a blank line, its last line won't be visible in the console for some reason
1081- stackTrace = stackTrace . Substring ( 0 , halfMaxLogLength - 12 ) + "<truncated>\n " ;
1082- }
1083- else
1084- {
1085- // Truncate logString
1086- logString = logString . Substring ( 0 , maxLogLength - stackTrace . Length - 11 ) + "<truncated>" ;
1087- }
1088- }
1089- else
1090- {
1091- // Truncate stackTrace
1092- stackTrace = stackTrace . Substring ( 0 , maxLogLength - logString . Length - 12 ) + "<truncated>\n " ;
1093- }
1094- }
1095- }
1096-
10971059 QueuedDebugLogEntry queuedLogEntry = new QueuedDebugLogEntry( logString, stackTrace, logType ) ;
10981060 DebugLogEntryTimestamp queuedLogEntryTimestamp;
10991061 if ( queuedLogEntriesTimestamps != null )
0 commit comments