Plugin for Salesforce CLI to help with the adoption of RFLIB - an open-source logging framework for Salesforce.
- Automatically instruments Apex classes with RFLIB logging statements
- Automatically instruments LWC components with RFLIB logging statements
- Automatically instruments Aura components with RFLIB logging statements
sf plugins install rflib-plugin
Adds RFLIB logging statements to Apex classes.
# Add logging to all classes in a directory
sf rflib logging apex instrument --sourcepath force-app
# Preview changes without modifying files
sf rflib logging apex instrument --sourcepath force-app --dryrun
# Format modified files with Prettier
sf rflib logging apex instrument --sourcepath force-app --prettier
# Skip instrumenting files where logging is already present
sf rflib logging apex instrument --sourcepath force-app --skip-instrumented
--sourcepath (-s)
: Directory containing Apex classes to instrument--dryrun (-d)
: Preview changes without modifying files--prettier (-p)
: Format modified files using Prettier--skip-instrumented
: Do not instrument files where RFLIB logging is already present
Adds RFLIB logging statements to Lightning Web Components.
# Add logging to all LWC files
sf rflib logging lwc instrument --sourcepath force-app
# Preview changes without modifying files
sf rflib logging lwc instrument --sourcepath force-app --dryrun
# Add logging and format code
sf rflib logging lwc instrument --sourcepath force-app --prettier
# Skip instrumenting files where logging is already present
sf rflib logging lwc instrument --sourcepath force-app --skip-instrumented
--sourcepath (-s)
: Directory containing LWC components to instrument--dryrun (-d)
: Preview changes without modifying files--prettier (-p)
: Format modified files using Prettier--skip-instrumented
: Do not instrument files where RFLIB logging is already present
Adds RFLIB logging statements to Aura Components.
# Add logging to all LWC files
sf rflib logging aura instrument --sourcepath force-app
# Preview changes without modifying files
sf rflib logging aura instrument --sourcepath force-app --dryrun
# Add logging and format code
sf rflib logging aura instrument --sourcepath force-app --prettier
# Skip instrumenting files where logging is already present
sf rflib logging aura instrument --sourcepath force-app --skip-instrumented
--sourcepath (-s)
: Directory containing Aura components to instrument--dryrun (-d)
: Preview changes without modifying files--prettier (-p)
: Format modified files using Prettier--skip-instrumented
: Do not instrument files where RFLIB logging is already present
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request