## Overview The RFLIB Plugin for Salesforce CLI accelerates the adoption of the RFLIB logging library by automating the instrumentation of logging statements into your Salesforce codebase. This plugin eliminates manual effort, promotes consistency, and ensures comprehensive logging coverage across your Apex classes, Lightning Web Components (LWC), and Aura components. ## Why Use the Plugin? Effective logging is crucial for monitoring and debugging applications, especially in dynamic Salesforce environments. However, implementing a robust logging framework like RFLIB can be challenging due to the repetitive nature of integrating logging statements. The RFLIB plugin addresses this challenge by automating the process. It: - Saves time and reduces errors during logging integration. - Standardizes logging practices across different components. - Supports seamless integration with RFLIB's powerful features, such as log aggregation, masking, and dashboards. - Encourages faster adoption of the RFLIB framework by developers. ## Key Features - **Automatic Instrumentation**: - Adds logging statements for method entry, parameter values, error handling, and condition blocks. - Automatically integrates with RFLIB's logger initialization. - **Component Support**: - Apex classes, including test classes. - Lightning Web Components (LWC). - Aura components. - **Customizable Behavior**: - Includes options to skip certain structures like `if/else` blocks. - Formats code using Prettier for consistent style. - **Preview Changes**: - Supports dry-run mode to preview modifications before applying them. ## Installation To install the plugin, run: ```bash sf plugins install rflib-plugin ``` For detailed installation steps, see the [README file](README.md). ## Commands ### Apex Instrumentation Analyze and instrument Apex classes with RFLIB logging statements. ```bash sf rflib logging apex instrument --sourcepath [--dryrun] [--prettier] [--no-if] ``` ### LWC Instrumentation Instrument JavaScript files in Lightning Web Components. ```bash sf rflib logging lwc instrument --sourcepath [--dryrun] [--prettier] [--no-if] ``` ### Aura Instrumentation Add logging to Aura components' controllers, helpers, and renderers. ```bash sf rflib logging aura instrument --sourcepath [--dryrun] [--prettier] [--no-if] ``` ## Examples - **Add logging to Apex classes**: ```bash sf rflib logging apex instrument --sourcepath force-app/main/default/classes ``` - **Preview changes for Aura components**: ```bash sf rflib logging aura instrument --sourcepath force-app/main/default/aura --dryrun ``` - **Instrument and format LWC components**: ```bash sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc --prettier ``` ## Additional Resources - [Getting Started with Logging](Getting-Started-with-Logging) - [Ops Center Overview](Ops-Center-Overview) ## Contribute We welcome contributions to enhance the RFLIB plugin. Visit the [GitHub repository](https://github.com/j-fischer/rflib-plugin) for more details on how to contribute.