forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
954 stars 406 forks source link

need VS code to dispaly only debug logs while executing Anonymous Apex #3998

Closed sogeisetsu closed 2 years ago

sogeisetsu commented 2 years ago

Is your feature request related to a problem? Please describe. I'm always frustrated when I executing Anonymous Apex code because i do not know how to dispaly only debug in vscode. in web developer console i have a button to click,so that i can let the console dispaly only debug logs while executing Anonymous Apex code.

Describe the solution you'd like I would like to know is there any solution to make VS code to dispaly only debug logs while executing Anonymous Apex Describe alternatives you've considered I would like to modify the Launch.json to make VS code to dispaly only debug logs while executing Anonymous Apex, just like when I debug node.js code. But I still don't know if I can achieve my idea by modifying lanuch.json. Maybe add a debug button just like the web developer console.

I don't know how other people have solved this problem at the moment, if you have a solution to this problem, I hope you tell me here, it's important to me.

sogeisetsu commented 2 years ago

now if i executing Anonymous Apex code,The bottom of vscode will output too much information that I can't use, I just want to see the information and error information output by my system.debug()

17:47:23.101 Starting Execute Anonymous Apex

Compiled successfully.
Executed successfully.

54.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO
Execute Anonymous: List<Id> ids = new List<Id>{'0015j00000bwZemAAE'};
Execute Anonymous: List<Account> lstAccount = [select id,Number_of_Contacts__c , (select id from contacts ) from account where id in :ids ];
Execute Anonymous: for( Account acc : lstAccount )
Execute Anonymous: {
Execute Anonymous:     List<Contact> lstCont = acc.contacts ;
Execute Anonymous:     System.debug('lstCont.size() '+lstCont.size());
Execute Anonymous: }
17:47:24.28 (28198649)|USER_INFO|[EXTERNAL]|0055j000005Yq39|suyuesheng@capgemini.com|(GMT+08:00) China Standard Time (Asia/Shanghai)|GMT+08:00
17:47:24.28 (28252145)|EXECUTION_STARTED
17:47:24.28 (28259270)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex
17:47:24.28 (40652944)|USER_DEBUG|[6]|DEBUG|lstCont.size() 1
17:47:24.40 (40744068)|CUMULATIVE_LIMIT_USAGE
17:47:24.40 (40744068)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 1 out of 100
  Number of query rows: 2 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of Publish Immediate DML: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

17:47:24.40 (40744068)|CUMULATIVE_LIMIT_USAGE_END

17:47:24.28 (40808499)|CODE_UNIT_FINISHED|execute_anonymous_apex
17:47:24.28 (40819281)|EXECUTION_FINISHED

17:47:23.907 ended Execute Anonymous Apex
sogeisetsu commented 2 years ago

Is there anyone find my issue? This is a business project, and I think someone should respond even if there is no solution.