LoginSignup
1

More than 5 years have passed since last update.

forceCLIでSystem.debug()の結果だけ抜き出す

Posted at

forceCLIだとローカルでApexコードが実行できます。

$ force apex anonymus.cls

開発者コンソールだとDebug OnlyのチェックボックスがあってSystem.debug()の結果だけ抜き出せるのですが、どうやらforceCLIにはそんなオプションはないみたいなので、cutコマンドでやってみました。

$ force apex anonymus.cls | grep USER_DEBUG | cut -d "[" -f2 | cut -d "]" -f2 | cut -d "|" -f3

sedでもいいけど、cutだと動きがわかりやすい。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1