GithubHelp home page GithubHelp logo

apexlogger's Introduction

ApexLogger

Minimalist logging service for Salesforce.com Apex.

Installation

You can install the package through the following link: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t58000000MypY

Key features

  • Specific object to save the logs to.
  • Possibility of specifing the lifespan of logs - A daily batch deletes older log records.
  • Enablement/Disablement of the logging through a custom setting.
  • Specific permission set to see the logs.
  • No-brainer API for the cozy developer :)

Example

public class AccountRenamer {
    private Logger logger;

    public AccountRenamer() {
        logger = new Logger('Account Renamer'); // Gets the log record corresponding to today or creates a new one in case it doesn't exist.
    }

    public static void rename(Account acc, String newName){
        logger.info('Renaming started...'); // Adds an information line to the log.
        try {
            /* Some code */
            logger.info('Renaming finished succesfully.');
        }
        catch(Exception e){
            logger.error(e.getMessage()); // Adds a new line with the error as well as setting the HasErrors__c field to true in the log.
        }

        logger.persistLog(); // Must be invoked at the end of the transaction in order to update the log record.
    }
}

apexlogger's People

Contributors

manzanit0 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.