I'm connected to a Playground org in VS Code.
I have made and deployed a class to this org and would like to run some anonymous code in VS Code to test a method of the class.
I was able to do this by Ctrl + Shift + P and SFDX: Execute Anonymous Apex with Editor Contents. However, the output is too verbose:
...whereas I would like to view |USER_DEBUG|
entries only.
This answer suggests using sfdx force:apex:log:tail
(since I'm on Windows, I had to use findstr
instead of grep
), but got the following error:
I also tried using the --loglevel
argument instead of grep
and got the same error:
But when I supply my username, nothing happens - the prompt just hangs:
When I press Ctrl + C, it asks me if I want to Terminate batch job (Y/N)?
Could it be because I'm using a Playground org instead of a scratch org?
EDIT: I tried running it in the VS Code terminal to no avail:
-u
argument. It appears you're in your home directory, which typically wouldn't be a suitable place for development.C:\Users\<user>\Desktop\VSCodeQuickStart> sfdx force:apex:log:tail -u <myusername> --loglevel=debug
, but it just hangs again. I'm not sure about the default username. The default username in my project's.sfdx-config.json
is set to "vscodeOrg", but runningsfdx force:apex:log:tail -u vscodeOrg --loglevel=debug
doesn't work.