function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Neil KimNeil Kim 

Why some debug log is not generated?

Hi! I have some trouble about debug log.

I tested some code  below.
 
System.debug('why is not shown2');
System.debug('size 1: ' + flowArr.size());
for( integer i = 0 ; i < flowArr.size() ; i ++ )
	System.debug('Mapping__c : ' + flowArr[i].Mapping__c);

for( integer i = 0 ; i < flow.size() ; i ++ )
	System.debug('Mapping__c2 : ' + flow[i].Mapping__c);

System.debug('why is not shown3');
List<integer> arr = new List<integer>();
//SYstem.debug('flow size : ' + flow.size());
for( integer i = 0 ; i < flow.size() ; i ++ ){
	for( integer j = 0 ; j < flowArr.size() ; j ++ ){
		if( flow[i].Mapping__c == flowArr[j].Mapping__c ){
			arr.add(i);
		}
	}
}

System.debug('why is not shown4');

This code is called by trigger.
and, in Developer Console, only 'why is not shown4' is appeared only.
'why is not shown2 and 3 is not appeared....

Is there any clue about it?
Because of it, I cannot do debuging..

Please help me.
Sumeet_ForceSumeet_Force
It should definitely print it...however in very rare cases....if the log being generated is too much ...then not all debug lines take place. Try this in a org where you call these directly and it should work fine...just to cross check.
D-CoderD-Coder
try this - (added null checks)
 
System.debug('why is not shown2');
if(flowArr != null && flowArr.size()>0)&&(flow != null && flow.size()>0){

	System.debug('size 1: ' + flowArr.size());
	for( integer i = 0 ; i < flowArr.size() ; i ++ )
		System.debug('Mapping__c : ' + flowArr[i].Mapping__c);

	for( integer i = 0 ; i < flow.size() ; i ++ )
		System.debug('Mapping__c2 : ' + flow[i].Mapping__c);

	System.debug('why is not shown3');
	List<integer> arr = new List<integer>();
	//SYstem.debug('flow size : ' + flow.size());
	for( integer i = 0 ; i < flow.size() ; i ++ ){
		for( integer j = 0 ; j < flowArr.size() ; j ++ ){
			if( flow[i].Mapping__c == flowArr[j].Mapping__c ){
				arr.add(i);
			}
		}
	}
}


System.debug('why is not shown4');

 
Neil KimNeil Kim
@sumeet_Force, @Nilesh

First of all, thank you, and it looks like, as sumeet said, print issue.

Maybe Developer Console has maximum line limit to show debugging log.
So, the first half is not printed, and the last half is printed..

If so, How do I get the first half of the log?
Sumeet_ForceSumeet_Force
Debugging is treated for entire block in same manner..So what you can try is following:
1. Make sure debugging is enabled on just this class and not on the trigger or any user.
2. Apart from Apex, ensure other debug levels are all set to lowest.

These 2 considerations shall help.