Skip to content

jordan-mathews/sf-logger-base

Repository files navigation

sf-logger-Base

Lightweight package used for logging in Salesforce. Uses platform events and flows to save log events as SystemLog__c records.

Publishing log events

Publish a single message with log lovel

Logger.getCurrent().publish('Test Error Message', LogLevel.ERROR);

Add multiple events and then publish all at once

Logger.getCurrent().add('Test Log Message 1', LogLevel.ERROR);
Logger.getCurrent().add('Test Log Message 2', LogLevel.ERROR);
Logger.getCurrent().add('Test Log Message 3', LogLevel.ERROR);
Logger.getCurrent().publish();

Salesforce Development Setup

  1. Install npm
  2. Install Salesforce DX CLI
    • Alternative: npm install sfdx-cli --global
  3. Clone this repository (GitHub Desktop is recommended for non-developers)
  4. Run npm install from the project root folder
  5. Install VS Code (recommended)
    • Install Salesforce Extension Pack
    • Install recommended plugins! A notification should appear when opening VS Code. It will prompt you to install recommended plugins.
  6. Install AdoptOpenJDK (only version 8 or 11)
  7. Open VS Code settings and search for salesforcedx-vscode-apex
  8. Under Java Home, add the following:
    • macOS: /Library/Java/JavaVirtualMachines/adoptopenjdk-[VERSION_NUMBER].jdk/Contents/Home
    • Windows: C:\\Program Files\\AdoptOpenJDK\\jdk-[VERSION_NUMBER]-hotspot

Build Project

To build the project locally using scratch orgs, follow these steps:

  1. If you have not authenticated to a DevHub run sfdx auth:web:login -d -a production and then log in.
  2. Create scratch org and push project source.
npm install
npm run mac:build

Install project in Sandbox or Production

  1. Authenticate to the environment that you would like to install the source to (it is recommended to always test in a sanbox first).
  2. run the following command:
sfdx force:source:deploy -p force-app/main/default -l RunLocalTests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published