Apex BOOST Library
v1.7 from Lucidware Solutions (LWS)

Util

global inherited sharing virtual class Util
DescriptionThis class contains diagnostic methods with several advantages over their System counterparts:
  • Context (class, method, line number) is auto-generated, saving you typing and debugging time! The simplest debug statement generates a wealth of information:
           class MyClass {
             void myMethod() {
               aBoost.debug(); // => DEBUG|scox~ MyClass.myMethod:3
             }
           }
         
  • Methods can be essentially disabled using Apex BOOST custom settings. For example, setting Debug Level to ERROR will prevent all aBoost.debug() calls from generating a debug entry.

In order for the debug/warning/info methods to work, you'll need to create a global class extending Util. Specify this class in the Apex BOOST custom settings, then override the onDebug method to write information to System.debug.

 global with sharing class ABoostDebug extends aBoost.Util {
   global override void onDebug(LoggingLevel level, String details) {
     System.debug(level, details);
   }
 }
 

Constructors

  Util

global Util()
Description Util provides a global constructor only so that onDebug can be implemented in client code. There is never a need to call new aBoost.Util().

Methods

  debug

global static String debug(Object message)
Description Write debug information to System.debug, auto-generating the class, method, and line number
Parametermessage: diagnostic information (text, exception, etc.)

  debug

global static String debug()
DescriptionWrite debug information to System.debug, auto-generating the class, method, and line number

  debug

global static String debug(LoggingLevel level, Object message)
Description Write debug information at the specified level to System.debug, auto-generating the class, method, and line number
Parametermessage: diagnostic information (text, exception, etc.)
ThrowsInvalidParameterValueException if level is null

  error

global static String error(Object message)
Description Write an error to System.debug, auto-generating the class, method, and line number
Parametermessage: diagnostic information (text, exception, etc.)

  error

global static String error()
DescriptionWrite an error to System.debug, auto-generating the class, method, and line number

  info

global static String info(Object message)
Description Write info to System.debug, auto-generating the class, method, and line number
Parametermessage: diagnostic information (text, exception, etc.)

  info

global static String info()
DescriptionWrite info to System.debug, auto-generating the class, method, and line number

  onDebug

global virtual void onDebug(LoggingLevel level, String details)
Description

In order for the debug/warning/info methods to work, you'll need to create a global class extending Util. Specify this class in the Apex BOOST custom settings, then override the onDebug method to write information to System.debug.

 global with sharing class ABoostDebug extends aBoost.Util {
   global override void onDebug(LoggingLevel level, String details) {
     System.debug(level, details);
   }
 }
 
ThrowsInvalidParameterValueException if level is null

  warn

global static String warn(Object message)
Description Write a warning to System.debug, auto-generating the class, method, and line number
Parametermessage: diagnostic information (text, exception, etc.)

  warn

global static String warn()
DescriptionWrite a warning to System.debug, auto-generating the class, method, and line number